Re: Am I using the InputMap and the ActionMap correctly?

Johannes Wahle <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <[email protected]>
You should initialize the keybindings in the constructor and not in 
componentActivated().

The short advice:
If you call setAction/InputMap methods, you loose all installed keybindings.
Instead you should call getAction/InputMap on the component that should 
react to the actions and add your keybindings.
These maps are organized hierarchically, so if a component does not have 
a binding for a key/action, it looks in its parent's maps.

For more information see: 
https://docs.oracle.com/javase/tutorial/uiswing/misc/keybinding.html

If your bindings still won't work inside a NetBeans Platform 
Application, you should try Benno's tip.
Just supply a new ExplorerManager. (Not sure, if you need to set 
selection and root context to Node.EMPTY)

Regards,
Johannes


On 29.05.2016 00:05, Klaus Martinschitz wrote:
> Hello,
>
> Thanks a lot for your fast answer.
> Unfortunately, thats not the problem. I have no ExplorerManagr in this top component.
> Thanks.
>
> Regards,
> Klaus
>
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.