KeyGrab – grab key combinations using TextField in Swing/Java.
Posted by ski | Filed under Developement, English
Description.
This small component was cut out form the bigger project. It’s extension of JTextLabel which easily can be added to you java swing project, to provide text box which can easily grab and display key combinations.
Features.
- Open source, free to use.
- Free access to current key combination associated with TextBox.
- Callbacks while new conbinations is being set.
- Possibility of overwiting names of the keys.
- Easy integartion with IDEs ( can be added as component to i.e. Netbens )
- anyway, it’s in-4-hours-made component – feature list ends here :)
Usage.
Key[] defaultKeys = new Key[]{ new Key(KeyEvent.VK_SHIFT), new Key('A') };
KeyGrab keyGrabTextBox = new KeyGrab(defaultKeys);
Download.
- All-in-one – keygrab-1.0-src.zip (71kb, zip)- source files, demo and jar ready to include to your project.
- Demo and component – keygrab-1.0-demo.jar (7kb, jar)- see demo or include it to the project.
- Component only – keygrab-1.0.jar (6k, jar)- add to your project and use.
Tags: Java, JTextField, key listener, Swing
