You can set the style by using the initStyle()
method that receives a StageStyle of your Stage .
Eg:
public class HelloWorld extends Application {
@Override
public void start(Stage stage) {
Text text = new Text(10, 40, "Hello World!");
text.setFont(new Font(40));
Scene scene = new Scene(new Group(text));
stage.initStyle(StageStyle.UNDECORATED)
stage.setTitle("Welcome to JavaFX!");
stage.setScene(scene);
stage.sizeToScene();
stage.show();
}
public static void main(String[] args) {
Application.launch(args);
}
}
Possible values are:
DECORATED
You define the normal Stage style with a solid white background and platform decorations.
Define a stage style with a solid white background
TRANSPARENT
You define the Stage style with a transparent background and no decorations.
Define a stage style with a transparent background and decorations.
UNDECORATED
You define the Stage style with a solid white background and no decorations.
Set a stage style with a white background and no decorations
UNIFIED
Define the Stage style with platform decorations and eliminate the border between client area and decorations.
Defines a stage style with decorations and eliminates the border between the client area and the decorations
UTILITY
You define the Stage style with a solid white background and minimal platform decorations used for a utility window.
Defines a stage style with a solid white background and minimal decorations used by a utility screen.
To leave in full screen, you can call the setFullScreen (boolean value) , true
to start in fullscreen, false otherwise