import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTextField;
public class Test {
public static void main(String[] args) {
new MyFrame("点击测试");
}
}
@SuppressWarnings("serial")
class MyFrame extends JFrame implements ActionListener{
JButton button=new JButton("点击我");
JTextField text=new JTextField("按钮点击了24次");
int count=24;
public MyFrame(String title) {
setTitle(title);
setLayout(new FlowLayout());
button.addActionListener(this);
add(button);
add(text);
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTextField;
public class Test {
public static void main(String[] args) {
new MyFrame("点击测试");
}
}
@SuppressWarnings("serial")
class MyFrame extends JFrame implements ActionListener{
JButton button=new JButton("点击我");
JTextField text=new JTextField("按钮点击了24次");
int count=24;
public MyFrame(String title) {
setTitle(title);
setLayout(new FlowLayout());
button.addActionListener(this);
add(button);
add(text);