public class SwingUtils
extends java.lang.Object
Constructor and Description |
---|
SwingUtils() |
Modifier and Type | Method and Description |
---|---|
static javax.swing.JComponent |
getDefaultFocusComponent(java.awt.Component aComponent)
Returns the default focus component.
|
static javax.swing.Icon |
getIcon(java.awt.Shape aShape,
java.awt.Color aColor,
int aWidth,
int aHeight)
Returns an icon for the given shape, color and size.
|
static javax.swing.ImageIcon |
getImageIcon(java.awt.Shape aShape,
java.awt.Color aColor,
int aWidth,
int aHeight)
Returns an image icon for the given shape, color and size.
|
static <T> T |
getParent(java.awt.Component aComponent,
java.lang.Class<T> aClass)
Returns the first parent of given component which is an instance of given class.
|
static java.awt.Window |
getWindow(java.awt.Component aComponent)
Returns the first parent of given component which is window.
|
static void |
invokeLater(java.lang.Object anObj,
java.lang.String aMethod)
Invokes an given method on a given object after delay.
|
static void |
invokeLater(java.lang.Object anObj,
java.lang.String aMethod,
java.lang.Object anArg,
java.lang.Class anArgClass)
Invokes an given method on a given object after delay, with given arg and arg class.
|
static void |
invokeLater(java.lang.Runnable aRunnable,
int aCount)
InvokesLater for a given count before running given runnable, in order to skip past events yet to be posted.
|
static void |
invokeLaterOnce(java.lang.String aName,
java.lang.Runnable aRunnable)
Invokes the given runnable for name once (cancels unexecuted previous invokeLater registered with same name).
|
public static java.awt.Window getWindow(java.awt.Component aComponent)
public static <T> T getParent(java.awt.Component aComponent, java.lang.Class<T> aClass)
public static void invokeLater(java.lang.Object anObj, java.lang.String aMethod)
public static void invokeLater(java.lang.Object anObj, java.lang.String aMethod, java.lang.Object anArg, java.lang.Class anArgClass)
public static void invokeLater(java.lang.Runnable aRunnable, int aCount)
public static void invokeLaterOnce(java.lang.String aName, java.lang.Runnable aRunnable)
public static javax.swing.Icon getIcon(java.awt.Shape aShape, java.awt.Color aColor, int aWidth, int aHeight)
public static javax.swing.ImageIcon getImageIcon(java.awt.Shape aShape, java.awt.Color aColor, int aWidth, int aHeight)
public static javax.swing.JComponent getDefaultFocusComponent(java.awt.Component aComponent)