java - JavaFX: JFXPanel in JFrame - Prevent JMenuBar mnemonics -
i have jfxpanel's contained within jframe has jmenubar top. menus have mnemonics associated them, though jfxpanel's have button's mnemonics associates them well. pressing alt + c invokes jfxpanel close button action, opens collections menu jmenubar. suggestions how handle?
adding jfxpanel did trick:
this.addkeylistener(new keylistener() { @override public void keytyped(keyevent e) { if(e.isaltdown()) { e.consume(); } } @override public void keyreleased(keyevent e) { if(e.isaltdown()) { e.consume(); } } @override public void keypressed(keyevent e) { if(e.isaltdown()) { e.consume(); } } });
Comments
Post a Comment