|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
org.pf.swing.FocusEnforcer
public class FocusEnforcer
This subclass of Thread can be used to set the focus of a window to a specific component. The thread is running until the component has the focus. This is particularly useful with modal dialogs (i.e. JDialog) where it is not possible in another way to set the focus to a component other than the first in the dialog.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
FocusEnforcer(javax.swing.JComponent focusComponent)
Initialize the new instance the component to put the focus on. |
|
FocusEnforcer(javax.swing.JComponent focusComponent,
java.lang.String name)
Initialize the new instance the component to put the focus on. |
|
| Method Summary | |
|---|---|
static void |
enforceFocusOn(javax.swing.JComponent focusComponent)
Starts a thread to put the focus on the given component. |
void |
run()
Actually execute the thread's purpose and set the focus on the desired component. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FocusEnforcer(javax.swing.JComponent focusComponent)
focusComponent - The component that should get the focus.
public FocusEnforcer(javax.swing.JComponent focusComponent,
java.lang.String name)
focusComponent - The component that should get the focus.name - The name of the thread| Method Detail |
|---|
public static void enforceFocusOn(javax.swing.JComponent focusComponent)
focusComponent - The component that should get the focus.public void run()
run in interface java.lang.Runnablerun in class java.lang.Thread
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||