How to open another window in JavaFX 2?
java, javafx, javafx-2
Solution
Button b = new Button();
b.setOnAction(new EventHandler<ActionEvent>() {
@Override public void handle(ActionEvent e) {
Stage stage = new Stage();
//Fill stage with content
stage.show();
}
});
Problem
I have made a simple JavaFX application, but I would like the main window to open a secondary window when the user clicks a button. What would be the simplest way to accomplish this?