0% found this document useful (0 votes)
5 views2 pages

GUI Application Design Exercises

Uploaded by

Amgd Talal
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

GUI Application Design Exercises

Uploaded by

Amgd Talal
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Computer Science Division 3rd Level Students - CS

Department of Mathematics Course: COMP 301


Faculty of Science Date: December 6th, 2021

Sheet 7
Exercise 1:
Design a GUI application that looks like the below figure

• The user should enter any two numbers at the top two JTextFields, then
according to the clicked JButton, the result of the corresponding
operation will appear at the bottom JTextField.
• The application should handle the expected exceptions such as:
o Division by zero
o Entering non-number values at the top two JTextFields
Exercise 2:
Redesign the above application so that add 4 JRadioButtons instead of the 4
JButton. The application should look like the below figure

Important Note:
You should add the 4 JRadioButtons onto a ButtonGroup to ensure
that the user could choose only one of the 4 JRadioButtons.
Computer Science Division 3rd Level Students - CS
Department of Mathematics Course: COMP 301
Faculty of Science Date: December 6th, 2021

Exercise 3:
Design a GUI application that looks like the below figure

• When the user enters a name and an age then clicks on the “save” button,
the entered data are stored into an array and the 2 JTextFields are cleared.
• When the user clicks on the “show” button, all the stored data in the array
are displayed into the JTextArea as in the following figure:

Homework:
Modify the above program:
• The entered data are encapsulated into an object of class “Student”.
• Add another 2 buttons
o Delete: to delete the data of the entered name.
o Search: to search for the data of the entered name.

You might also like