|
Try to create a refresh button.
And try this code. I hope it helps.
public void actionPerformed(ActionEvent event) {
String command = event.getActionCommand();
if (command.equals("Connect")) {
try {
SockTest mySock = new SockTest();
chat.append(mySock.chatText);
} catch (IOException ioe) {
chat.setText("Error " + ioe.getMessage());
}
}
else if (command.equals("Refresh")) {
//Create your refresh here
}
}
|