Java Reference
In-Depth Information
Let's explore each of these high-level items shown in the previous image:
F Stage—this component represents the outer-most visible window in a JavaFX desktop
application. It defines the application's main physical window and serves as a container
for all other graphical components that make up the application. The Stage exposes
several useful properties that are used in the previous code sample:
title:String —this is the title of the stage. In a windowed-
application, this is the title displayed in the title bar of the top-level
width:Number —this property specifies the initial width of the
application's window.
height:Number —this property specifies the initial height of the
application's window.
visible:Boolean —this property indicates whether the window is
visible. The default is visible.
x:Number and y:Number —by default the the JavaFX application
framework will center the application window on the device screen.
You can however, specify the location of the window.
scene:Scene —this property is used to plug in an instance of the
Scene class to the stage. The scene is where all visible content to
be rendered is placed (see description of Scene next).
F Scene—this class represents the canvas where visible content will be drawn.
Content to be rendered on the scene is logically grouped in a tree-like structure
called the Scene-Graph (see Nodes next) and is attached to the Scene's content
property. The Scene class exposes several useful properties when building the
application including:
fill:Color —this property specifies a Color instance used for the
scene. As of version 1.2 of the SDK, the default color for the stage is
height:Number , width:Number —by default, the scene inherits
the stage's dimension. However, you can use these properties to
override the dimensions of the stage.
content:Node[] —this property is of type Sequence where one
or more scene graphs containing visual objects to be rendered are
attached (see Nodes next).
F Nodes (or Node-Tree)—these are the visual objects that are added to the scene
to be rendered. Nodes are logically grouped in tree-like structures, named scene
graphs, where nodes can be either leaf nodes (visual components) with at most
one parent, or branch nodes (containers) with many leaf nodes attached.
Search WWH ::

Custom Search