private JMenu file = new JMenu("文件")
private JMenuItem quit = new JMenuItem("退出")
file.add(quit)
quit.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
jQuit_ActionPerformed(e)
}
})
private void jQuit_ActionPerformed(ActionEvent e){
System.exit(0)
}
JMenuBar jMenuBar = new JMenuBar()JMenu jMenu1 = new JMenu()
jMenu1.setText("File")
jMenuBar1.add(jMenu1)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)