Hi all I'm confused about how to get my button to do something when it is clicked, my understanding after searching is that the following should work:
However im getting an illegal start of of expression for my method header and also a ';' expected at the the last }
Anyone see something I don't??
However im getting an illegal start of of expression for my method header and also a ';' expected at the the last }
Anyone see something I don't??
Code:
aButton.addActionListener(this);
Code:
public void actionPerformed(ActionEvent e)
{
String aString = inputArea.getText();
if(aString.equals("exit"))
{
socket.close();
System.exit();
}
else
{
outStream.println(aString);
}
}
}
Comment