GUI – Refinements – Error Messages

This entry is part 11 of 13 in the series Zellers Algorithm

The next refinement is simple. I want the output box to change colour, when the output of the calculation contains the word ‘Error’. How I have decided to handle this is by creating a new String before sending setting it as the content of the JTextField element. I have also decided to add a few …
Continue reading GUI – Refinements – Error Messages

GUI Refinements – Focus

This entry is part 12 of 13 in the series Zellers Algorithm

The next refinement, is that I want the Year textfield to clear when it is either clicked on or tabbed to. In order to do this i need to implement not only the ActionListener but also the FocusListener. To do this I simply have to change the class header from: to this: I then have …
Continue reading GUI Refinements – Focus

GUI Refinements – Today

This entry is part 13 of 13 in the series Zellers Algorithm

My final refinement (for the moment) is that, I want today’s date to be the default date. To do this I need to import two libararies: I then need to get the current date: In order to get each part of the date (day, month, year), i will simply use the SimpleDateFormat library, and create …
Continue reading GUI Refinements – Today