Window Decorating

    Aren't you tired of the old fashion default window title from JavaFX? Have you ever thought about creating your very own window title and the minimize icon? This section will teach you how to decorate the window title bar, and the icon. To create an image to use for your icon, make sure it is a 32x32 pixel. Lets see an example.

This is the stageStyle class. Inside here we create the minimize button, exit button, and the title for the window. As for the minimize and exit button I created a mouse event,
every time the user clicks on the buttons the mouse action will fire up. Now, we will create a main method that contains the Stage.

 

This is the main class, it consists the Stage. We call the stageStyle class to create the title bar, minimize, and exit button. In addition we create the minimize display icon inside the stage class.
Copy the program, test it yourself and see.

 

 <JavaFX><JavaFX Example><Home>