I am working on a simple program where in the code below I need to display "Hello, (name entered)!" instead of "A very good name!". I'm not sure how to display the input from the user to the screen. Does anyone have any suggestions on the best way to do this? Thanks!
public void actionPerformed(ActionEvent e)
{
if (e.getActionCommand().equals("Test")
name.setText("A very good name!"
else if (e.getActionCommand().equals("Clear")
name.setText(""
else
name.setText("Error in window interface."
}
public void actionPerformed(ActionEvent e)
{
if (e.getActionCommand().equals("Test")
name.setText("A very good name!"
else if (e.getActionCommand().equals("Clear")
name.setText(""
else
name.setText("Error in window interface."
}