All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----com.trumphurst.controls.ContainerFocusTracker | +----com.trumphurst.controls.ContainerKeyTracker
To use, just create a tracker, passing it the Container you want to deal with.
Note that this extends ContainerFocusTracker, which corrects a bug in Java 1.1 where focus is not handled correctly.
By default, plain letter and number keys are only intercepted from Buttons and Checkboxes. Control and Function keys, Escape, and Enter are intercepted from all components. Note that the interception of the Tab and Enter keys doesn't work in TextComponents. For TextComponents, the Control key is required in conjunction with the Tab or Enter key.
The default behaviour recognises the following components ...
If there are duplicate components that would use the same key, that key is ignored.
Of course, you can modify this default behaviour, by programmatically adding or removing links between a particular key and a Component. You can also turn key trapping and/or key reception on and off for a particular component, or for a whole class of Component. You can also turn the default behaviour on and off.
public ContainerKeyTracker(Container c, boolean defaultBehaviour)ContainerKeyTracker
public ContainerKeyTracker(Container c)
public void keyPressed(KeyEvent e)
protected void addComponent(Component c)
protected void removeComponent(Component c)
All Packages Class Hierarchy This Package Previous Next Index