Lesson 19Developing JavaFX Calculator and Tic-Tac-Toe
Now that you’re familiar with the basics of JavaFX, it’s time to write some practical applications. In this lesson you program the calculator and the game of Tic-Tac-Toe. In Lesson 18 you wrote the application in Java, but this time you create the graphical user interface (GUI) part with a declarative language—FXML. The application logic and event handling remain in Java.
In this lesson you get familiar with Scene Builder—a design tool that enables you to create a GUI by dragging and dropping components (buttons, text fields, labels, and so on) right onto the content panel (the center area of Scene Builder as shown in Figure 19-4 ). While you design the view with Scene Builder it generates a file with the name extension .fxml
, which contains XML-like tags with attributes that reflect your design.
You also see how to dynamically change the styling of components using cascading style sheets (CSS).
Designing a Calculator with Scene Builder
I assume that you already have the Efxclipse plug-in installed as described in Lesson 18. Now you need to download and install Scene Builder from Oracle at http://bit.ly/1rnw1S5
.
If you’ve completed the assignment from the Try It section of Lesson ...
Get Java Programming 24-Hour Trainer, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.