Lesson 19: Developing JavaFX Calculator and Tic‐Tac‐Toe

Yakov Fain · 2015

This chapter focuses on programming the calculator and the game of Tic-Tac-Toe. It talks about a Scene Builder, which is a design tool that enables you to create a graphical user interface (GUI) by dragging and dropping components right onto the content panel. 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. The chapter also explains how to dynamically change the styling of components using cascading style sheets (CSS). The file Calculator.fxml contains the calculator's GUI represented by XML-like tags. In particular, the tag corresponds to the JavaFX BorderLayout container. The chapter discusses two use cases for clicking the calculator's buttons. Each JavaFX event is inherited from javafx.event.Event, which has such fields as source and target.

Read the paper · More papers on PaperTik