Java Reference
In-Depth Information
5
Create User
Interfaces
“One difference between poetry and lyrics is that lyrics sort of fade into the
background. They fade on the page and live on the stage when set to music.”
—Stephen Sondheim
User Interfaces
The primary focus of JavaFX is to provide a platform to easily and quickly
develop cool user interfaces. The goal is to create appealing user interaction that
engages the user's full senses and leaves the user with a positive impression. At
the core of this is JavaFX's user interface classes.
JavaFX employs a theater metaphor within the JavaFX user interface framework.
There is a stage that provides space for the action and presents a focal point for
the user. A scene represents a slice of the action or discrete unit of the applica-
tion. A layout positions the individual components within a scene.
In this chapter, we will cover the key elements required to build a user interface
in JavaFX. This chapter covers the basic user interface components, whereas
subsequent chapters will discuss animations, special effects, and multimedia fea-
tures. To begin, you must first define your stage .
The Stage
The javafx.stage.Stage class is the topmost container for a JavaFX display. It
insulates the underlying implementation from the JavaFX developer so it can be
93
 
 
 
Search WWH ::




Custom Search