Minimize window jfx

0

My window is missing the system borders.

primaryStage.initStyle(StageStyle.UNDECORATED);

I created a button to minimize the window but exception when assigning to my stage :

@FXML
void btnMinimizarOnAction(ActionEvent event) throws IOException
{
    Stage stage = (Stage) btnMinimizar.getScene().getWindow();
    stage.setIconified(true);
}

Is there any other way to do this?

    
asked by anonymous 12.11.2015 / 19:04

1 answer

1

There may be different ways to get Stage , but the setIconified(true) method should be called.

    
12.11.2015 / 20:06