本帖最后由 凝聚 于 2013-11-27 11:02 编辑
package twenty_two;
import java.awt.*;
import java.awt.event.*;
public class eleven {
public static void main(String[] args) {
new Menu();
}
}
class Menu
{
private Frame f;
private MenuBar mb;
private MenuItem mi;
private Menu m;
Menu()
{initt();}
public void initt()
{
f=new Frame("中");
f.setBounds(300,200,500,999);
f.setLayout(new FlowLayout());
mb=new MenuBar();
m=new Menu("文件");\\\\\\\\\\\\\\\\\\\
mi=new MenuItem("退出");
m.add(mi);\\\\\\\\\\\\\\\\\\\\\
mb.add(m);\\\\\\\\\\\\\\\\\\\\\\\\\\
f.setMenuBar(mb);
mevent();
f.setVisible(true);
}
private void mevent()
{
f.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
}
}
这段代码中表“\\\\\"号的地方有错误,请问是怎么回事啊?
|