Java Reference
In-Depth Information
There's more...
The style property of the Stage class is of type StageStyle , which exposes two other
predefined styles including:
F StageStyle.DECORATED —this style produces a normal window decorated with
a border and window controls such as the minimize, maximize, and close buttons.
This is the default style for the stage.
When the window's border is decorated, you can also control whether the window
can be resized using the stage's Boolean property called resizable .
F StageStyle.UNDECORATED —this style is the opposite of decorated. It removes
the window's border decoration leaving only a thin line around the window's edge.
When you use this style, ensure that you provide your users with a way to close and
drag the application's window.
Controlling opacity
You can also control the opacity of your application's window on the desktop. Here's how to
do it:
Stage {
title : "Border Style"
style: StageStyle.TRANSPARENT;
opacity: 0.5
scene: Scene {
content: [
The opacity property is a decimal value ranging from 0.0 to 1.0 where 0.0 means
complete transparency and 1.0 means full opacity. The next screenshot shows a window
with an opacity value of 0.5 . Notice the content of other application bleeding through the
application's content.
See also
F Building a JavaFX application
Search WWH ::

Custom Search