class3.this 是什么意思啊
ublic class Class3 extends JFrame implements ActionListener {
JButton btn = new JButton("结束");
/**
* @throws java.awt.HeadlessException
*/
public Class3() throws HeadlessException {
super("窗口标题");
getContentPane().add(btn);
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
btn.addActionListener(this);
}
/*
* (non-Javadoc)
*
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(Class3.this, "ffffff");
if (e.getSource() == btn)
System.exit(0);
}
public static void main(String[] args) {
Class3 c3 = new Class3();
c3.setSize(100, 100);
c3.pack();
c3.show();
}
}