For Programmers: Free Programming Magazines  


Home > Archive > Java Help > January 2007 > Re: How do you constantly enforce JTextField.requestFocus() upon certain key presses/









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: How do you constantly enforce JTextField.requestFocus() upon certain key presses/
phillip.s.powell@gmail.com

2007-01-19, 7:08 pm

Never mind, I got it, huge thanx to Google!

/*
* ComponentFocusGrabber.java
*
* Created on January 19, 2007, 2:13 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/

package GUIGraphics;

import javax.swing.JComponent;

/**
* For more information on this class
* {@link
http://groups.google.com/group/comp...680228c30bf7d6d
click here}
* @author Phil
*/
public class ComponentFocusGrabber extends JComponent implements
Runnable {

private JComponent c;

/** Creates a new instance of ComponentFocusGrabber */
public ComponentFocusGrabber(JComponent c) {
this.c = c;
}

public void refocus(JComponent c) {
c.grabFocus();
}

public void run() {
refocus(c);
}

}

Phil

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com