Java Reference
In-Depth Information
There's more...
CustomNode and all other node types share a common ancestor, the Node class. Therefore,
your custom node has access to all of the positional, effects, transformation, animation
properties, and functionalities exposed by the Node class. Nodes can also receive keyboard
and mouse events, including key up, key down, mouse up, mouse down, mouse pressed, and
so on.
Defining your own node also means that you can place your custom component anywhere
in the scene graph including directly on the scene, in a group, participate in layout, and be a
branch node to other nodes. If you are building a composite node that consists of more than
one node, group them in a branch node such as Group , Layout , Panel , and so on and the
branch node from the create() function.
See also
F Declaring and using variables
F Declaring and using JavaFX classes
F Handling user inputs
F Making your scripts modular
Controlling your application's window style
As we have seen in the previous recipe, Building a JavaFX application , the Stage represents
the outer-most window of a desktop application. The stage encapsulates many properties
that control how the window is styled on the screen. This recipe explores how to control and
change the style and behavior of your application's window.
Getting ready
Window style, in this recipe, refers to the border decoration that goes around the application
window displayed on the screen. In this context, style does not refer to other attributes such
color, size, and so on. Using the style attribute of the window, for instance, you can make a
chromeless window: that is, when the border and all other window controls are removed from
the window.
How to do it...
To change the style of your application's window, you set the value of the style property
of the Stage as shown next. The full listing of the code for this recipe can be found in ch02/
source-code/src/application/StageStyleDemo.fx .
 
Search WWH ::




Custom Search