当我使用多个LAF时,如何执行this之类的操作:
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
答案 0 :(得分:0)
我用这种方式解决了我的问题:
public class MyMenuItem extends JMenuItem {
public MyMenuItem(String text) {
super(text);
}
@Override
protected void processMouseEvent(MouseEvent evt) {
if (evt.getID() == MouseEvent.MOUSE_RELEASED && contains(evt.getPoint())) {
doClick();
setArmed(true);
} else
super.processMouseEvent(evt);
}
}