University of Dar es Salaam
College of Information and Comm Tech.
Computer and Systems Engineering Department
CS175 : Programming in Java
19th June 2024
Develop a Java Swing program to perform simple registration. The interface will look as
in Figure 1 on page 2. The password and confirm password inputs should be password
fields. Column width for Full Name is 30 characters, for passwords is 15, for BirthYear
is 6. BirthMonth, Gender and Country fields are ComboBoxes. BirthMonth should
contain a string NotSelected plus months names of the Year (January, February, etc).
Gender should contain an array of strings: NotSelected, Male and Female. Country
should contain an array of string formed from a string NotSelected plus countries forming
Eastern Africa Community.
Note the following:
• All values in the combo boxes Gender and Country should be displayed when a user
clicks on these combo boxes. The maximum number of viewable months should be 6
(including NotSelected).
• When user clicks Save button, the program should check if the entered data are valid
according to the following four conditions.
(i) The fullname should have three names (FirstName Middlename Surname)
arranged in that order.
(ii) The password should have at least 8 characters
(iii) Combo boxes should contain valid selection.
(iv) The Year should be between 2005 and 2010 all inclusive.
If ANY of the above four conditions is not satisfied, then display a popup error
message with the text "Please check your entries, something is wrong.
If all four conditions are met and a Save button is clicked, the program should save
the information in a text file called [Link] in the current folder and then
display the entered values in the popup window as presented below (each item is
displayed in a separate line):
Fullname: ____________________
Password: ____________________
Birth Month: __________________
Birth Year: ___________________
Age (yrs): ____________
Gender: ______________
Page 1 of 2
Country: _________________________
• The title of the popup window should be Registered Information and should
have font name of Serif, bold and size of 28.
• The Birth Year and age should be saved as integers, the rest should be saved as
Strings. .
• When the Reset Button is clicked, it should reset the fields.
• When the Exit button is clicked, the application should be terminated.
• The double cross in the BirthYear field in the figure should be ignored!
Figure 1
Page 2 of 2