[java] How to create a popup windows in javafx

I want to create a popup windows in javafx application.give me some idea.
enter image description here

when i click on check button open popup windows. how to do?

This question is related to java javafx javafx-2 javafx-8 scenebuilder

The answer is

You can either create a new Stage, add your controls into it or if you require the POPUP as Dialog box, then you may consider using DialogsFX or ControlsFX(Requires JavaFX8)

For creating a new Stage, you can use the following snippet

public void start(final Stage primaryStage) {
    Button btn = new Button();
    btn.setText("Open Dialog");
        new EventHandler<ActionEvent>() {
            public void handle(ActionEvent event) {
                final Stage dialog = new Stage();
                VBox dialogVbox = new VBox(20);
                dialogVbox.getChildren().add(new Text("This is a Dialog"));
                Scene dialogScene = new Scene(dialogVbox, 300, 200);

If you don't want it to be modal (block other windows), use:


Similar questions with java tag:

Similar questions with javafx tag:

Similar questions with javafx-2 tag:

Similar questions with javafx-8 tag:

Similar questions with scenebuilder tag: