大家看一下是怎么回事:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class FirstApplication extends JFrame;
{
JButton myButton = new JButton("Click Me");
Container myContainer;
public FirstApplication()
{
super("FirtApplication");
myContainer = getContentPane();
myContainer.setLayout(new FlowLayout(FlowLayout.CENTER));
myContainer.add("center", myButton);
setSize(300,100);
setVisible(true);
myButton.addActionListener(new MyActionListener());
}
class MyActionListener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
JOptionPane.showConfirmDialog(null, "You have clicked the button!");
}
}
static class myWindowListener extends WindowAdapter
{
public void windowsClosing(WindowEvent e)
{
System.exit(0);
}
}
public static void main(String s[])
{
FirstApplication myApp = new FirstApplication();
myApp.addWindowListener(new myWindowListener());
myApp.setVisible(true);
}
}
编译时总是过不去,提示上面的错误!!!!!!!!!!!!!!!!!!!!