Lab 14: GUI Exercise
Objective
To become more familiar with GUI programming in Java.
Task
For this lab, you will create a simple GUI program with Swing. The program will contain a window with three components:
They will need to be contained inside of a BoxLayout.
The label should tell the user to enter a number in the field below.
The text field will allow the user to enter a number.
When the button is pressed, the application should read the text in the text field, convert it to a number, calculate the factorial of the number, and display it in a popup window to the user.
Details
- The examples in class detail the use of a BoxLayout, JLabel, JButton and messages.
- You will need to read about the JTextField on your own.
- You can use Integer.parseInt(string) to convert text into an int.
- You can use Integer.toString(number) to convert from an int to a String
Submitting
When you are done, please submit the Java code under the assignment in Canvas.