Package de.alpharogroup.swing.utils
Class AwtExtensions
- java.lang.Object
-
- de.alpharogroup.swing.utils.AwtExtensions
-
public final class AwtExtensions extends java.lang.ObjectThe classAwtExtensions
-
-
Constructor Summary
Constructors Constructor Description AwtExtensions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.awt.ComponentgetRootJDialog(java.awt.Component component)Gets the root JDialog from the given Component Object.static java.awt.ComponentgetRootJFrame(java.awt.Component component)Gets the root JFrame from the given Component Object.static java.awt.ComponentgetRootParent(java.awt.Component component)Gets the root parent from the given Component Object.static java.awt.WindowgetWindowForComponent(java.awt.Component component)Gets the toplevelFrameorDialogstatic java.awt.CursornewInvisibleCursor()Creates an invisible cursor.static voidsetIconImage(java.lang.String resourceName, java.awt.Window window)Sets the icon image from the given resource name and add it to the given window object.
-
-
-
Method Detail
-
getRootJDialog
public static java.awt.Component getRootJDialog(java.awt.Component component)
Gets the root JDialog from the given Component Object.- Parameters:
component- The Component to find the root JDialog.- Returns:
- 's the root JDialog.
-
getRootJFrame
public static java.awt.Component getRootJFrame(java.awt.Component component)
Gets the root JFrame from the given Component Object.- Parameters:
component- The Component to find the root JFrame.- Returns:
- 's the root JFrame.
-
getRootParent
public static java.awt.Component getRootParent(java.awt.Component component)
Gets the root parent from the given Component Object.- Parameters:
component- The Component to find the root parent.- Returns:
- 's the root parent.
-
getWindowForComponent
public static java.awt.Window getWindowForComponent(java.awt.Component component) throws java.awt.HeadlessExceptionGets the toplevelFrameorDialog- Parameters:
component- the parent component- Returns:
- the the toplevel
FrameorDialog - Throws:
java.awt.HeadlessException- ifGraphicsEnvironment.isHeadlessreturnstrue- See Also:
GraphicsEnvironment.isHeadless()
-
newInvisibleCursor
public static java.awt.Cursor newInvisibleCursor()
Creates an invisible cursor.- Returns:
- s the created invisible cursor.
-
setIconImage
public static void setIconImage(java.lang.String resourceName, java.awt.Window window) throws java.io.IOExceptionSets the icon image from the given resource name and add it to the given window object.- Parameters:
resourceName- The name from the resource. This includes the absolute path to the image icon from the classpath.window- the window in which to set the icon image.- Throws:
java.io.IOException- Signals that an I/O exception has occurred.
-
-