-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchatButAction.java
More file actions
23 lines (17 loc) · 842 Bytes
/
chatButAction.java
File metadata and controls
23 lines (17 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import javax.swing.*;
import java.awt.event.ActionEvent;
public class chatButAction extends AbstractAction{
public void actionPerformed(ActionEvent ev) {
Interface.textArea.setText("");
Interface.textField.setText("");
Interface.historyButton.setText("History");
Interface.button.setText("Send");
Interface.status.setText("Connect to somebody");
Interface.historyButton.removeActionListener(this);
Interface.historyButton.addActionListener(new historyButAction());
Interface.button.removeActionListener(Interface.textListener);
Interface.textField.removeActionListener(Interface.textListener);
Interface.button.addActionListener(Interface.textListener = new TextAction());
Interface.textField.addActionListener(Interface.textListener);
}
}