문제

How can I do something like this while I'm using multiple LAFs:

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
도움이 되었습니까?

해결책

I've solved my problem this way:

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);
    }

}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top