ComponentUtil Class
- public class ComponentUtil
extends Object
This class has some simple methods to support utilties on components.
-
Hierarchy
-
Object
ComponentUtil
public static boolean |
-
isDescendant (Container parent, Component child)
- Determines if the given child is a descendent (contained by) the given container
|
public static boolean |
-
isFocusContainer (Component c)
- Determines whether or not the given component either has focus, or contains the component
that currently has focus.
|
Methods from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ComponentUtil
public ComponentUtil()
isDescendant(Container, Component) Method
public static boolean isDescendant(Container
parent,
Component
child)
Determines if the given child is a descendent (contained by) the given container
Parameters
-
parent
- Container to check for in parent hierarchy
-
child
- Component to use as starting point in search
Returns
- true if the given parent is part of the childs parent hierarchy, false otherwise
isFocusContainer(Component) Method
public static boolean isFocusContainer(Component
c)
Determines whether or not the given component either has focus, or contains the component
that currently has focus.
Parameters
-
c
- Component to determine focus containment for
Returns
- true if c either has focus, or contains a component that has focus, false otherwise