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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!