JFoenix
JFoenix copied to clipboard
JFXPopup
In my the version of the JFoenix library that i have downloaded, the JFXPopup class does not seem to appear in my scene builder.
Also, there is no setContent() method in the JFXPopup class even when I open it in my controller class.
How do I fix this?
Hello, True, JFXPopup has been reworked. it doesn't extend the Node class anymore, thus you can't add it in scene builder as a node. Here is an example for JFXPopup:
public class PopupDemo extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
JFXListView<Label> list = new JFXListView<>();
for (int i = 1; i < 5; i++) {
list.getItems().add(new Label("Item " + i));
}
JFXButton button = new JFXButton("Popup!");
StackPane main = new StackPane();
main.getChildren().add(button);
JFXPopup popup = new JFXPopup(list);
// popup.setPopupContent(list);
button.setOnAction(e -> popup.show(button, PopupVPosition.TOP, PopupHPosition.LEFT));
final Scene scene = new Scene(main, 800, 800);
primaryStage.setTitle("JFX Popup Demo");
primaryStage.setScene(scene);
primaryStage.setResizable(false);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
Regards,
How to attach JFXPopup to scene/ window?
Error:
Below is the code:
