-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhistoryButAction.java
More file actions
23 lines (17 loc) · 875 Bytes
/
historyButAction.java
File metadata and controls
23 lines (17 loc) · 875 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 historyButAction extends AbstractAction{
public void actionPerformed(ActionEvent ev) {
Interface.textArea.setText(TextFile.read());
Interface.historyButton.setText("Chat");
Interface.button.setText("Find");
Interface.textField.setText("");
Interface.status.setText("To search, type something and press the button");
Interface.button.removeActionListener(Interface.textListener);
Interface.textField.removeActionListener(Interface.textListener);
Interface.button.addActionListener(Interface.textListener = new Finder());
Interface.textField.addActionListener(Interface.textListener);
Interface.historyButton.removeActionListener(this);
Interface.historyButton.addActionListener(new chatButAction());
}
}