给该类实现 ActionListener接口并实现抽象方法:
public void actionPerformed(ActionEvent evt) {
if (evt.getSource() instanceof JMenuItem) {
String arg = evt.getActionCommand();
if (arg.equals(".......")) {
XFrame a = new XFrame();
a.setVisible(true);
}
else if (........) {
}
}
public void actionPerformed(ActionEvent evt) {
if (evt.getSource() instanceof JMenuItem) {
String arg = evt.getActionCommand();
if (arg.equals(".......")) {
XFrame a = new XFrame();
a.setVisible(true);
}
else if (........) {
}
}
我会好好学习!
现在去实施程序!!!