Method Summary |
|
public static Color | alpha(Color c, int alpha) Return a copy of the given color with a new alpha component. |
public static void | cascade(Window w) Cascade the given window based on the currently active
Frame . |
public static void | cascade(Window w, int xoff, int yoff) Cascade the given window based on the currently active
Frame . |
public static void | centerOnFrame(Window window, Frame frame) Center on the specified frame. |
public static void | centerOnScreen(Window window) Center the given
Window on the default screen. |
public static Color | combine(Color c1, Color c2) Combine the two colors with equal weight. |
public static Color | combine(Color c1, Color c2, float weight) Combine the two colors, giving the requested weight to the first. |
public static boolean | containsFocus(Component c) Return whether the given component either has focus or is the ancestor
of the focused component. |
public static void | dismissAWTPopup() Ensure any extant AWT popup is dismissed. |
public static void | ensureOnScreen(Window w) Ensure the given window is visible on screen. |
public static boolean | eventTypeEnabled(Component c, int id) WARNING: This uses 1.3/1.4 implementation details. |
public static Component | find(Component root, Class type) Find the first instance of the given class under the given component,
or null if none found. |
public static Component | find(Component root, ComponentPredicate test) Find the first component matching the given predicate,
or null if none found. |
public static MenuItem[] | findAWTMenuItems(Frame frame, String path) Returns all MenuItems matching the given label or path which are found
in the given Frame's MenuBar. |
public static MenuItem[] | findAWTPopupMenuItems(Component parent, String path) Returns all MenuItems matching the given label or path which are on
PopupMenus on the given Component. |
public static JPopupMenu | findActivePopupMenu() Find the currently active Swing popup menu, if any, waiting up to
POPUP_TIMEOUT ms. |
public static Applet | findAppletDescendent(Container c) Returns the Applet descendent of the given Container, if any. |
public static RootPaneContainer | findRootPaneContainer(Container c) Find the first instance of
RootPaneContainer in the given
container. |
public static JPopupMenu | getActivePopupMenu() Returns the currently active popup menu, if any. |
public static Window | getActiveWindow() NOTE: NOT necessarily the same thing as the focused window. |
public static AppContext | getAppContext(Component c) For debugging purposes only. |
public static Component | getFocusOwner() Return the focus owner under the given Window. |
public static Window | getFocusedWindow() NOTE: on pointer-focused systems, the frontmost window is not
necessarily the one with focus. |
public static Frame | getFrame(Object o) Return the
Frame corresponding to the given object. |
public static GraphicsConfiguration | getGraphicsConfiguration(Point p) Returns the GraphicsConfiguration which contains the given point,
or null if none. |
public static Insets | getInsets(Container c) |
public static Component | getInvoker(MenuComponent mc) Returns the invoker, if any, of the given AWT menu component. |
public static Component | getInvoker(Component comp) Returns the invoker, if any, of the given component. |
public static String | getKeyCode(int keycode) |
public static int | getKeyCode(String code) |
public static String | getKeyModifiers(int flags) |
public static Point | getLocationOnScreen(Component c) Safe version of
Component.getLocationOnScreen , which
avoids lockup if an AWT popup menu is showing. |
public static int | getModifiers(String mods) Convert the string representation into the actual modifier mask. |
public static String | getModifiers(InputEvent event) Convert the integer modifier flags into a string representation. |
public static String | getMouseModifiers(int flags) |
public static String | getPath(MenuItem item) Returns a unique path to the given MenuItem. |
public static int | getPopupMask() Returns the InputEvent mask for the popup trigger button. |
public static PopupMenu[] | getPopupMenus(Component c) Return all AWT popup menus associated with the given component. |
public static boolean | getPopupOnPress() Returns whether the platform registers a popup on mouse press. |
public static int | getTertiaryMask() Returns the InputEvent mask for the tertiary button. |
public static Rectangle | getVirtualDisplayBounds(boolean includeInsets) Returns a Rectangle spanning all screens. |
public static Rectangle | getVisibleBounds(GraphicsConfiguration gc) Return the visible bounds for the graphics configuration. |
public static Window | getWindow(Object o) Return the window corresponding to the given object. |
public static Window | getWindow(Component comp) Similar to SwingUtilities.getWindowAncestor(), but returns the
component itself if it is a Window, or the invoker's window if on a
popup. |
public static boolean | hasDefaultName(Component c) Return whether the given Component has only its default name set. |
public static boolean | hierarchyHasHeavyweightComponent(Component base) whether the hierarchy within which the given Component sitscontains a heavyweight component. |
public static void | invokeAction(Runnable action) Ensure the given action happens on the event dispatch thread. |
public static void | invokeAndWait(Runnable action) Ensure the given action happens on the event dispatch thread. |
public static boolean | isAWTPopupMenuBlocking() Returns whether there is an AWT popup menu currently showing. |
public static boolean | isAWTTreeLockHeld(EventQueue eq) Returns whether the AWT Tree Lock is currently held. |
public static boolean | isAppletViewerFrame(Component c) |
public static boolean | isContentPane(Component c) Returns whether the given Component is the content pane for a
RootPaneContainer . |
public static boolean | isGlassPane(Component c) Returns whether the given Component is the Glass Pane for a
JRootPane . |
public static boolean | isHeavyweightPopup(Component c) Returns whether the given component is a heavyweight popup, that is, a
container for a JPopupMenu that is implemented with a heavyweight
component (usually a Window). |
public static boolean | isInternalFrameDecoration(Component c) Return whether the given component is part of an internal frame's LAF
decoration. |
public static boolean | isLightweightPopup(Component c) Returns whether the given component is a lightweight popup, that is, a
container for a JPopupMenu that is implemented with a lightweight
component (usually JPanel). |
public static boolean | isMenuActive(Component c) Returns true if there is an active menu on the JFrame (if any)
containing the given component. |
public static boolean | isModifier(int keycode) |
public static boolean | isOnMenuBar(MenuComponent mc) Returns whether the menu component is on a MenuBar. |
public static boolean | isOnPopup(MenuComponent mc) Returns whether the given MenuComponent is on a top-level AWT popup
(that is, not under a MenuBar. |
public static boolean | isOnPopup(Component comp) Returns whether the given component is on a top-level popup. |
public static boolean | isSharedInvisibleFrame(Component c) |
public static boolean | isTertiaryButton(int mods) Return whether this is the tertiary button, considering primary to be
button1 and secondary to be the popup trigger button. |
public static boolean | isToolTip(Component c) Return whether the given component is part of the transient wrapper
around a tooltip. |
public static boolean | isTransientDialog(Component c) Return whether the given component is part of a transient dialog. |
public static boolean | isTransientPopup(Component c) Return whether the given component is part of the transient wrapper
around a popup. |
public static int | keyCodeToMask(int code) |
public static int | maskToKeyCode(int mask) Convert the given modifier event mask to the equivalent key code. |
public static void | moveFrameRelativeTo(Frame frame, Component relativeTo) |
public static boolean | onScreen(Point p) Return whether the given
Point is visible on any screen. |
public static boolean | onScreen(Window w) Returns whether one of the upper corners of the given window is
accessible. |
public static Component | retargetMouseEvent(Component comp, int id, Point pt) If a component does not have mouse events enabled, use the
first ancestor which does. |
public static void | setHTMLPreferredWidth(JComponent c, int width) Ensure the given component renders its initial HTML wrapped at the
given preferred width. |
public static void | setLocationByPlatform(Window w) Set the position of the window in a platform-specific manner.
Uses Window.setLocationByPlatform if available, otherwise
centers on screen. |
public static void | showFrameRelative(Frame frame, Component relativeTo) Display a frame relative to the given component. |