Object Oriented Programming in Java

Module [M06] - JavaFX Basics

With this module, we are going to apply what we have learned so far about OOP to implement Graphical User Interfaces (GUI). GUIs are a good illustrative application of OOP techniques in general. We will focus on the JavaFX framework which is a re-design of the Swing framework that was previously used to implement GUIs in Java. As you will see, this framework makes implementing GUIs a breeze based on the OOP techniques we studied.

  • Textbook Reading Assignments
  • The following sections of the textbook are assigned for this module.
    • Chapter #14 – JavaFX Basics

Module Learning Outcomes

In this module, you will develop further your programming skills as follows;

Tracing
Ability to read and trace Java programs leveraging JavaFX Basics.
Implementing
Ability to write Java programs leveraging JavaFX Basics.
Testing
Ability to develop tests for Java programs leveraging JavaFX Basics.
Debugging
Ability to troubleshoot Java programs leveraging JavaFX Basics.
Designing
Ability to design Java programs leveraging JavaFX Basics.

In this module, we are going to supplement the reading assignments with apprenticeship videos that will help you see how you may build, step by step, the kind of programs that you will have to work on as part of your homework assignments.

  • A01 - Flags
  • File Link: YouTube
  • This exercise is practice exercise #14.01 in the latest edition of our text We start by using a GridPane to display four images representing different country flags
  • A02 - CheckerBoard
  • File Link: YouTube
  • This exercise is practice exercise #14.06 in the latest edition of our text We draw a 8 by 8 checkerboard in a pane, the hard way.
  • A03 - CheckerBoardGrid
  • File Link: YouTube
  • This exercise is based on practice exercise #14.06 in the latest edition of our text Same as the previous exercise, but this time we leverage GridPane to draw our CheckerBoard
  • A04 - Solitaire
  • File Link: YouTube
  • This exercise is practice exercise #14.08 in the latest edition of our text Bit of a misnomer here since we are not implementing a game of solitaire but simply displaying the 52 cards of a deck of playing cards, represented by png files, in another GridPane.
  • A05 - PieCharts
  • File Link: YouTube
  • This exercise is practice exercise #14.13 in the latest edition of our text A draw-it-as-you-see-it exercise in which we implement by hand the display of a given piechart
  • A06 - TicTacToe
  • File Link: YouTube
  • This exercise is practice exercise #14.16 in the latest edition of our text Another draw-it-as-you-see-it exercise but this time we will also leverage what we learned about binding properties to make a TicTacToe board resize automagically as we resize the enclosing window

To work on these exercises, you will need some of the image files provided with the examples source code from the Textbook. Download these at this URL.

  • B01 - Tic-Tac-Toe
  • This exercise is #14.2 in the 10th edition of our text.
  • B02 - Display 3 cards
  • This exercise is #14.3 in the 10th edition of our text.
  • B03 - Color & Font
  • This exercise is #14.4 in the 10th edition of our text.
  • B04 - Enter the Matrix
  • This exercise is #14.7 in the 10th edition of our text.
  • B05 - Display Barchart
  • This exercise is #14.12 in the 10th edition of our text.