How to turn off a key listener in NetBeans wizard panels?

前端 未结 2 417
无人共我
无人共我 2020-12-11 21:21

I developed a simple plugin for NetBeans IDE. I have a little problem with default key event on TopComponenet of Wizard panel:

For example:

I ha

2条回答
  •  甜味超标
    2020-12-11 22:22

    I'm not sure but if you know which JComponent causes this behaviour, try this:

    suspectedComponent.getInputMap().put(KeyStroke.getKeyStrokeForEvent(KeyEvent.VK_ENTER),"none");
    

    To check which keystrokes are bound on a JComponent:

    suspectedComponent.getInputMap().keys()
    

    Or in the parent InputMap:

    suspectedComponent.getInputMap().getParent().keys()
    

    See the docs for InputMap for details.

提交回复
热议问题