Minimize window in javafx2

I have an unecorate window in javafx2. Now I want to minimize the window with an action. This is my code.

minIcon.setOnMouseClicked(new EventHandler<MouseEvent>() { public void handle(MouseEvent me) { primaryStage.toBack(); } }); 

The window returns when another is open. otherwise it is not. Pls let me know how to do this?

+7
source share
1 answer

After several searches, I found the answer myself.

 minIcon.setOnMouseClicked(new EventHandler<MouseEvent>() { public void handle(MouseEvent me) { primaryStage.setIconified(true); } }); 

It works great.

+25
source

All Articles