This is a util class to support the four arrow keys navigation in any container. To use it, you can call
new ArrowKeyNavigationSupport().install(container);
The container could be any container. A typical use case is the button panel. By default we used it in {@link com.jidesoft.dialog.ButtonPanel} class to enable left/right/up/down key.
By default, all components will be navigable in the container but you can further define what components are navigable by using the constructor
new ArrowKeyNavigationSupport(Class[] componentTypes)
where componentTypes is the list of the classes of the components that you would like to be navigable. For example,
new ArrowKeyNavigationSupport(new Class[]{ AbstractButton.class }).install(container);
to only allow any buttons (JButton, JideButton, JCheckBox, JRadioButton) etc.
You can also allow certain keys to be used. For example.
new ArrowKeyNavigationSupport(new int[]{ KeyEvent.VK_LEFT, KeyEvent.VK_RIGHT}).install(container);
if only left and right keys are making sense to navigate in your container.