CISC 3115
Modern Programming Techniques
Lab 08 JavaFX


This lab has you playing a bit with JavaFX to familiarize you with the basic structure of an application, as well as some of the various components covered in the lectures.

There are two portions to the lab: a required application, and a series of other optional applications that you may find interesting/challenging to implement — feel free to do as many or few of the latter as you wish.

Submitting this Lab

The only exercise you should submit is the required one (next section). As this lab is not being placed into Codelab, please send me an email of your source as well as several screen captures similar to what I present below.

The Required Application — A Simple Calculator


Create an application with three text fields and four buttons:

The Optional Applications

The following a various applications you may find interesting/challenging/'fun' to implement — the main purpose is to further familiarize you with JavaFX programming.
  1. Create an application with two stages:

  2. Draw the Olympic logo of the five colored rings

  3. Draw a smiley face

  4. Have two buttons control some attribute of a shape

  5. Draw a clock face with a second hand, and a button

  6. For 04-TextFields: add a 'Clear' button to the text field application that clears out the contents of the two text fields

  7. Look up the TextArea class in the API. Place a text area labelled document, and a text field labelled search for on the applet. Have a button labelled Search, which when clicked looks for the first occurrence of the search for field in the document area. The resulting position/text (or an indication that it wasn't found) should be displayed in a non-editable text field. Test your application by placing some lengthy text into the document area and then enter various searches in the search for field.

  8. Code an applet with 10 buttons positioned like a phone keypad —

  9. Create a virtual screen keyboard (like you see on tablets or smartphones. There should be a (single-line) text field that displays the text being typed. Some ideas: Full disclosure: I (deliberately) haven't implemented this one myself, so I'm not too sure how hard some of the suggestions are.

  10. Code an application that displays a calculator keyboard

  11. Create a rubber banding effect

  12. Display a rectangle on the screen and allow the user to drag and drop the rectangle to another location