public class FocusTracker
extends java.lang.Object
Component
of some Container
.Constructor and Description |
---|
FocusTracker(java.awt.Component root)
Creates a new focus tracker.
|
Modifier and Type | Method and Description |
---|---|
protected void |
add(java.awt.Component component)
Adds listeners to
component and its children to track the focus. |
void |
destroy()
Removes any listeners this
FocusTracker added anywhere allowing this FocusTracker
to be collected by the garbage collector. |
java.awt.Component |
getLastFocused()
Gets the last component that was focused
|
protected void |
remove(java.awt.Component component)
Removes listeners from
component and its children. |
public FocusTracker(java.awt.Component root)
root
- the root container whose children can be focusedpublic void destroy()
FocusTracker
added anywhere allowing this FocusTracker
to be collected by the garbage collector.public java.awt.Component getLastFocused()
null
, will be a child of the root container or the root
container itselfprotected void add(java.awt.Component component)
component
and its children to track the focus.component
- the component and its children to trackprotected void remove(java.awt.Component component)
component
and its children.component
- the component to remove