質問編集履歴
2
コードの修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -12,11 +12,10 @@
|
|
12
12
|
|
13
13
|
import java.awt.ActiveEvent;
|
14
14
|
import java.awt.BorderLayout;
|
15
|
+
import java.awt.event.ActionListener;
|
15
16
|
|
16
17
|
import javax.swing.JButton;
|
17
18
|
import javax.swing.JFrame;
|
18
|
-
import javax.swing.event.AncestorEvent;
|
19
|
-
import javax.swing.event.AncestorListener;
|
20
19
|
|
21
20
|
|
22
21
|
public class SampleApp extends JFrame{
|
1
コード修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -30,7 +30,7 @@
|
|
30
30
|
|
31
31
|
JButton b1 = new JButton("Click");
|
32
32
|
|
33
|
-
b1.
|
33
|
+
b1.addActionListener(new MyJButtonActionAdapter());
|
34
34
|
|
35
35
|
this.add(b1,BorderLayout.CENTER);
|
36
36
|
|
@@ -45,7 +45,7 @@
|
|
45
45
|
}
|
46
46
|
}
|
47
47
|
|
48
|
-
class MyJButtonActionAdapter implements
|
48
|
+
class MyJButtonActionAdapter implements ActionListener{
|
49
49
|
|
50
50
|
public void actionPerformed(ActiveEvent ev) {
|
51
51
|
|