JFoenix icon indicating copy to clipboard operation
JFoenix copied to clipboard

JFXPopup

Open Conrad6 opened this issue 9 years ago • 2 comments

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?

Conrad6 avatar Jul 20 '17 19:07 Conrad6

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,

jfoenixadmin avatar Jul 20 '17 20:07 jfoenixadmin

How to attach JFXPopup to scene/ window? Error: image Below is the code: image

ZaheerUdDeen avatar Dec 20 '17 08:12 ZaheerUdDeen