Java Reference
In-Depth Information
Figure 2-2. A screenshot of the StageCoach example
The StageCoach program was created to coach you through the finer points of using the Stage class and related
classes such as StageStyle and Screen . Also, we use this program to show you how to get arguments passed into
the program. Before walking through the behavior of the program, go ahead and open the project and execute it by
following the instructions for building and executing the Audio-Config project in Chapter 1. The project file is located
in the Chapter02 directory subordinate to where you extracted the topic's code download bundle.
eXaMINING the BehaVIOr OF the StaGeCOaCh prOGraM
When the program starts, its appearance should be similar to the screenshot in figure 2-2 . to fully examine its
behavior, perform the following steps. note that for instructional purposes, the property and method names on the
Ui correspond to the properties and methods in the Stage instance.
1.
notice that the stageCoach program's window is initially displayed near the top of the screen,
with its horizontal position in the center of the screen. Drag the program's window and
observe that the x and y values near the top of the Ui are dynamically updated to reflect its
position on the screen.
2.
resize the program's window and observe that the width and height values change to reflect
the width and height of the Stage . note that this size includes the decorations (title bar and
borders) of the window.
3.
Click the program (or cause it to be in focus some other way) and notice that the focused
value is true. Cause the window to lose focus, perhaps by clicking somewhere else on the
screen, and notice that the focused value becomes false.
 
Search WWH ::




Custom Search