Objectives

Students will be able to:

Task 4

ButtonClick Logic [Criterion C]

 

A button needs to be added that will generate a user registration number for a new member.

When the button is clicked, an algorithm produces a random registration number.

When the submit button is clicked, this data will be written at the start of the user information string.

But we are already using our Action Listener on the submit button!

Is it possible to add multiple action listeners to components on the same panel...

Task A

You need to figure out how to add a second action listener to a new button on the panel.

Task B

Design your own way to generate a random registration number for a new member. For example, it could be the first letter of their forename followed by the first letter of their surname followed by 4 random number 1-9.

Task C

When you have a registration number, see if you can update the submit button action.

If no registration number is available, a warning message is displayed (like we did before).

If all data has been entered, then the registration number is the first item added to the string before writing to the text file.

Tags

iterative cycle client survey observe stakeholder


SUBSCRIBE

Join my mailing list to receive updates on the latest blog posts and other things.