Java Code Examples for javax.swing.JComponent.addKeyListener()

The following are Jave code examples for showing how to use addKeyListener() of the javax.swing.JComponent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: Equella   File:   Source Code and License Vote up 6 votes
public void installUI(JComponent c)

	mBackgroundNormal = UIManager.getColor("Button.background");
	mBackgroundPressed = UIManager.getColor("Button.backgroundPressed");
	mBackgroundActive = UIManager.getColor("Button.backgroundActive");
	mTextNormal = UIManager.getColor("Button.textNormal");
	mTextPressed = UIManager.getColor("Button.textPressed");
	mTextActive = UIManager.getColor("Button.textActive");
	mTextDisabled = UIManager.getColor("Button.textDisabled");
	mBorder = UIManager.getBorder("Button.border");

Example 2
Project: java-swing-template   File:   Source Code and License Vote up 5 votes
public static void attachFocusMoveOnKey(JComponent current, final JComponent target, final int keyCode) {
    current.addKeyListener(new KeyAdapter() {

        public void keyPressed(KeyEvent e) {
            if (e.getKeyCode() == keyCode) {