-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEventHendl.java
More file actions
48 lines (38 loc) · 1.33 KB
/
Copy pathEventHendl.java
File metadata and controls
48 lines (38 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.beans.EventHandler;
public class EventHendl {
public void Hundler(){
JFrame jFrame = Main.getFrame();
JPanel jPanel = new JPanel();
jFrame.add(jPanel);
JButton jButton = new JButton("Submit");
jPanel.add(jButton);
// jButton.addActionListener(new ActionListener() {
// @Override
// public void actionPerformed(ActionEvent e) {
// jFrame.setTitle(((JButton)e.getSource()).getText() );
// }
// });
jButton.addActionListener(EventHandler.create(ActionListener.class, jFrame, "title", "Source.text"));
JButton jButton1 = new JButton("Nimdus");
JButton jButton3 = new JButton( new MyAction());
jPanel.add(jButton1);
jPanel.add(jButton3);
jButton1.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
}
});
jFrame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
super.windowClosing(e);
int i = 0;
}
});
}
}