Java Reference
In-Depth Information
Chapter 6
Using the JavaFX UI Controls
Miracles are a retelling in small letters of the very same story which is written across the whole
world in letters too large for some of us to see.
—C. S. Lewis
In Chapter 2 you learned how to create user interfaces (UIs) in JavaFX by creating a stage, putting a scene on the
stage, and putting nodes in the scene. You also learned how to handle mouse and keyboard events, as well as how to
animate nodes in the scene.
In this chapter we pick up the UI discussion from Chapter 2 by showing you how to use the UI controls available
in JavaFX. The knowledge you've gained about property binding in Chapter 4 and layouts in Chapter 5 will serve you
well in this chapter, as it builds on those concepts.
Trying Out the JavaFX UI Controls
JavaFX has a rich set of UI controls for creating your applications. These range from relatively simple controls such as
TextField to more complex controls such as WebView . To get you up to speed quickly on these controls, we've created
an example application named StarterApp. This application has an example of most of the UI controls available in
JavaFX, and it also serves as a starting point from which you can use modifications to create an application.
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 AudioConfig project in Chapter 1. The project file is located in the
Chapter06 directory subordinate to which you extracted the topic's code download bundle.
eXaMINING the BehaVIOr OF the Starterapp prOGraM
When the program starts, its appearance should be similar to the screenshot in Figure 6-1 .
 
Search WWH ::




Custom Search