To demonstrate the topics covered in this chapter, I have written a small clock application.
It will become more complex with each upcoming chapter; for the first release it just shows a current local time in text form and updates it every second, demonstrating Stage/Scene usage, one of the layout managers, and the Application FX Thread workflow:
See the inline comments for details about the program:
// chapter1/clock/ClockOne.javapublic class ClockOne extends Application { // we are allowed to create UI objects on non-UI thread private final Text txtTime = new Text(); private volatile boolean enough = false; // this is timer ...