Question: Develop a simple Java GUI, including two JTextFields and one JButton. The first text field is for name input and the second is for age
Develop a simple Java GUI, including two JTextFields and one JButton. The first text field is for name input and the second is for age input,
- The name cannot be zero character or longer than 15 characters. A character can be either a space, a dash -, an alphabet, or a ,. No other characters or digits are allowed; otherwise, a name exception is thrown to the output or command prompt window.
- The age must be between 0 and 100 inclusively; otherwise, an age exception is thrown in a similar manner.
- The jbutton is only clickable once both jtextfields have valid inputs
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
