SuperVCD管理系统 java版完整代码 带各种注释....(4)
发布时间:2021-06-07
发布时间:2021-06-07
SuperVCD管理系统 完整代码,带各种注释,可以拿这个项目入门。
this.addWindowListener(new WindowCloser());
fileMenu.setMnemonic('f');
exitMenuItem.setMnemonic('x');
helpMenu.setMnemonic('h');
aboutMenuItem.setMnemonic('a');
//设定快捷键
exitMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X,
ActionEvent.CTRL_MASK));
saveMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,
ActionEvent.CTRL_MASK));
aboutMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A,
ActionEvent.CTRL_MASK));
}
/**
* 设定和选择外观
*
*/
protected void setupLookAndFeelMenu(JMenuBar theMenuBar) {
UIManager.LookAndFeelInfo[] lookAndFeelInfo
UIManager.getInstalledLookAndFeels();
JMenu lookAndFeelMenu = new JMenu("选项");
JMenuItem anItem = null;
LookAndFeelListener myListener = new LookAndFeelListener();
try {
for (int i=0; i < lookAndFeelInfo.length; i++) {
anItem = new JMenuItem(lookAndFeelInfo[i].getName() + " 外观"); anItem.setActionCommand(lookAndFeelInfo[i].getClassName());
anItem.addActionListener(myListener);
lookAndFeelMenu.add(anItem);
}
}
catch (Exception e) {
e.printStackTrace();
}
theMenuBar.add(lookAndFeelMenu); =
上一篇:六年级尖子生测试卷
下一篇:学生学习水平测试分析