|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object biz.chitec.quarterback.swing.KeyStrokeReader
Reads key strokes direcly from the keyboard.
This class can be used to define key strokes for shortcuts etc. directly from
the keyboard. It opens a modal JOptionPane and lets the user enter the key stroke.
readKeyStroke()
returns the complete key stroke which has been entered
or null if nothing has been entered or the entered key stroke has not been
confirmed.
Field Summary | |
private javax.swing.JDialog |
dlg
|
private boolean |
finished
|
private javax.swing.JOptionPane |
jop
|
private javax.swing.JPanel |
jp
|
private javax.swing.JLabel |
lbl
|
private int |
modifier
|
private static QuickIntArray |
modifierkeys
|
private java.util.ResourceBundle |
rb
|
private javax.swing.JTextField |
showlabel
|
private int |
vk
|
Constructor Summary | |
KeyStrokeReader(java.awt.Component parent)
Define the reader as descendant from a certain component. |
Method Summary | |
void |
keyPressed(java.awt.event.KeyEvent e)
Internal method for key event handling. |
void |
keyReleased(java.awt.event.KeyEvent e)
Internal method for key event handling. |
static java.lang.String |
keyStrokeToString(javax.swing.KeyStroke ks)
Reduced emulation of Java 1.5 code for Java 1.4 environments. |
void |
keyTyped(java.awt.event.KeyEvent e)
Internal method for key event handling. |
javax.swing.KeyStroke |
readKeyStroke()
Show the reader dialog and return the entered key stroke. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static QuickIntArray modifierkeys
private javax.swing.JOptionPane jop
private javax.swing.JDialog dlg
private javax.swing.JLabel lbl
private javax.swing.JTextField showlabel
private javax.swing.JPanel jp
private boolean finished
private int modifier
private int vk
private java.util.ResourceBundle rb
Constructor Detail |
public KeyStrokeReader(java.awt.Component parent)
parent
- Component to align the dialog window toMethod Detail |
public javax.swing.KeyStroke readKeyStroke()
public void keyTyped(java.awt.event.KeyEvent e)
keyTyped
in interface java.awt.event.KeyListener
public void keyPressed(java.awt.event.KeyEvent e)
keyPressed
in interface java.awt.event.KeyListener
public void keyReleased(java.awt.event.KeyEvent e)
keyReleased
in interface java.awt.event.KeyListener
public static java.lang.String keyStrokeToString(javax.swing.KeyStroke ks)
|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |