Teacher’s Calculator – Learning how to create GUIs in Java takes your coding to the next level and empowers you to start your Grade 12 PAT project.

Up to this point your coding has had to run sequentially from top to bottom without user interventions. The big advantage of a program having GUIs is that it becomes “event-driven” i.e. the user clicks on action buttons with their mouse and only terminates the program when they have completed their task.

We are going to use NetBeans and JFrameForm to code our GUIs. Below are three PowerPoint shows for you to download and watch. The files are 200Mb, 150Mb, and 500Mb respectively – it is suggested that you download them when internet traffic is less busy. It will probably take you 3 hours to watch all three of them (not in one sesssion of course)  NOTE: Coding GUIs is needed for the grade 12 PAT project but is never required in any practical Java coding exam. So while you need to be able to do the work, you do not have to memorize any GUI coding constructs. 

The presentations show you how to create a teacher’s mark book, capturing personal details and marks from the keyboard before working out the term’s average mark and presenting the results in a report.

GUI One. Accepts the learners name, grade 12 and school
GUI Two. Quote of the day – a fun screen for you be be creative with
GUI Three. Accepts three tests and calculates the percentage for each individual test
GUI Four. Reports the name, the grade and the overall average from the three tests.

The presentations cover . . . 

  • How to design 4 GUIs and customize them.
  • How to link them together with action buttons.
  • Using getter methods to get the test results. Using setter methods to output the percentage.
  • Using more setter methods to create a report screen with the final result.
  • The fourth presentation (for grade 11 only) adds some validation and additional functionality.

Once you have watched the presentations you must create your own unique version. You will be able to extend the scope of your own GUI project by adding additional code that rounds the answers off, validates the user input, and customizes the look-and-feel on the interfaces.

NOTE: This is a small part of what would become a much bigger program latter on. (bare bones approach). The final version (not shown here) would save the learner’s name, grade, school and results into a database.

Here is presentation one.

Projects, packages, class, UI, main method, panel, panel size, labels, text fields, properties, layered panel

Here is a presentation two.

Consistent font and colour, text area, code behind buttons, button next, button back, button exit

Here is presentation three.

Getter methods, setter methods, global variables, getting data off one GUI and using it on another GUI,
protected, protected static, more on labels, editable or non-editable text fields

Grade 11 only

Here is presentation four

Data validation using drop down list (combo box), looping back to GUI one to input another learner,
overview of some of the other components, text area with append