好多错误啊
import javax.swing.*;import java.awt.event.*;
import java.awt.event.*;
class FirstWindow extends JFrame{
JMenuBar menubar;
JMenu menu;
JMenuItem item1,item2;
FirstWindow(String s)
{
super(s);
setSize(160,170);
setLocation(120,120)
setVisible(true);
menubar=new JMenuBar();
menu=new JMenu("文件");
item1=new JMenuItem("打开",new ImageIcon("open.gif"));
item2=new JMenuItem("保存",new ImageIcon("save.gif"));
item1.setAccelerator(KeyStroke.getAWTKeyStroke(`O`));
item2.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,InputEvent.CTRL_MASK));
menu.add(iteam1);
menu.addSeparator();
menu.add(iteam2);
menubar.add(menu);
set.JMenuBar(menubar);
validate();
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}
}
public classExample
{public static void main(String args[])
{
FirstWindow win=new FirstWindow("一个简单的窗口");
}
}