jimm.datavision.gui
Class FocusSetter

java.lang.Object
  extended by jimm.datavision.gui.FocusSetter
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class FocusSetter
extends java.lang.Object
implements java.awt.event.ActionListener

Gives focus to a component, since often after building a frame the component we want to have focus doesn't get it.

Based on code found at http://privat.schlund.de/b/bossung/prog/java/tips.html. Modified to perform the focus request only once.

Author:
Jim Menard, jimm@io.com

Field Summary
protected  javax.swing.JComponent component
           
protected  javax.swing.Timer timer
           
protected static int WAIT_MILLISECS
           
 
Constructor Summary
FocusSetter(javax.swing.JComponent comp)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WAIT_MILLISECS

protected static final int WAIT_MILLISECS
See Also:
Constant Field Values

component

protected javax.swing.JComponent component

timer

protected javax.swing.Timer timer
Constructor Detail

FocusSetter

public FocusSetter(javax.swing.JComponent comp)
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Specified by:
actionPerformed in interface java.awt.event.ActionListener