Pregunta

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

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
¿Fue útil?

Solución

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

}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top