Question
Finish a specified portion of a GUI program.This program checks whether a user name is valid. For the purpose of this question, a valid user
Finish a specified portion of a GUI program.This program checks whether a user name is valid. For the purpose of this question, a valid user name should have at least 6 characters and start with a letter (either lowercase or uppercase).The simple illustration below shows the frame window with title "Is this a valid user name?", a prompt message label, a textfield for input, a check button, and a result label for displaying check result:
Is this a valid user name?
Try a user name: _________ ( a textfield for input)
Check (button)
(resultLabel, initially empty)
... // proper imports
public class TestWindow extends JFrame implements ActionListener
{
private JTextField nameTextField;// user input
private JLabel resultLabel;// display result
...
public void actionPerformed(ActionEvent e)
{
// ADD CODE to handle the action event on the button
} // end actionPerformed
} // end class TestWindow
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started