I have to create an application in which minimize and maximize button will be disabled.
I have used "StageStyle.UNDECORATED"
with which the application will not be movable or draggable anymore, so I am searching for any other alternative to make my application.
Do anyone having solution for this?
To achieve the window to be undecorated but still movable/dragable you have to handle the appropriate
MouseEvent
on any node of your choice.Example:
Learn more from the very valuable examples contained on Oracle's JavaFX download page under: JavaFX Demos and Samples
Sole purpose of this class is to allow undecorated Window to be dragged. It also performs the duty to ensure TaskBar remains visible with FullScreen, and ensure undecorated window not dragged out of screen. Lastly its provides a bug fix to the error "css resource not found." Simply paste below code in the main class in the overridden start() method just about when the Stage is ABOUT READY to be shown or after.
NOTE: Paste the above when the Stage is ABOUT READY to be shown or after. For full screen window use:
To resize back to previous use:
To add custom stylesheets to your scene, Simply paste below code in the main class in the overridden start() method after defining your scene.
The name of css to be used for styling can be in the form of:
main.css
orstyles/main.css