public final class WindowUtils
extends java.lang.Object
| Constructor and Description |
|---|
WindowUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <W extends java.awt.Window> |
center(W window)
Centers window relative to screen center.
|
static <W extends java.awt.Window> |
center(W window,
java.awt.Component relativeTo)
Centers window relative to the specified component center.
|
static <W extends java.awt.Window> |
center(W window,
java.awt.Component relativeTo,
int width,
int height)
Changes window size and centers it relative to screen center.
|
static <W extends java.awt.Window> |
center(W window,
int width,
int height)
Changes window size and centers it relative to screen center.
|
static <W extends java.awt.Window> |
detachFrom(java.awt.Component component)
Detaches window from the specified component.
|
static <W extends java.awt.Window> |
getAttachedTo(W window)
Returns component this window is attached to.
|
static <W extends java.awt.Window> |
getWindowOpacity(W window)
Returns window opacity.
|
static <W extends java.awt.Window> |
isWindowOpaque(W window)
Returns whether window is opaque or not.
|
static <W extends java.awt.Window> |
packAndCenter(W window)
Packs and centers specified window relative to old position.
|
static <W extends java.awt.Window> |
packAndCenter(W window,
boolean animate)
Packs and centers specified window relative to old position.
|
static <W extends java.awt.Window> |
packToHeight(W window,
int height)
Packs window to its preffered width and specified height.
|
static <W extends java.awt.Window> |
packToWidth(W window,
int width)
Packs window to its preffered height and specified width.
|
static <W extends java.awt.Window> |
setAttachedTo(W window,
java.awt.Component component)
Attached window to the specified component.
|
static <W extends java.awt.Window> |
setWindowOpacity(W window,
float opacity)
Sets window opacity if that option is supported by the underlying system.
|
static <W extends java.awt.Window> |
setWindowOpaque(W window,
boolean opaque)
Sets window opaque if that option is supported by the underlying system.
|
public static <W extends java.awt.Window> boolean isWindowOpaque(W window)
W - window typewindow - window to processpublic static <W extends java.awt.Window> W setWindowOpaque(W window,
boolean opaque)
W - window typewindow - window to modifyopaque - whether should make window opaque or notpublic static <W extends java.awt.Window> float getWindowOpacity(W window)
W - window typewindow - window to processpublic static <W extends java.awt.Window> W setWindowOpacity(W window,
float opacity)
W - window typewindow - window to modifyopacity - new window opacitypublic static <W extends java.awt.Window> java.awt.Component getAttachedTo(W window)
W - window typewindow - attached windowpublic static <W extends java.awt.Window> W setAttachedTo(W window,
java.awt.Component component)
W - window typewindow - window to attachcomponent - component to attach window topublic static <W extends java.awt.Window> W detachFrom(java.awt.Component component)
W - window typecomponent - component to detach window frompublic static <W extends java.awt.Window> W center(W window)
W - window typewindow - window to processpublic static <W extends java.awt.Window> W center(W window,
java.awt.Component relativeTo)
W - window typewindow - window to processrelativeTo - component used to center windowpublic static <W extends java.awt.Window> W center(W window,
int width,
int height)
W - window typewindow - window to processwidth - new window widthheight - new window heightpublic static <W extends java.awt.Window> W center(W window,
java.awt.Component relativeTo,
int width,
int height)
W - window typewindow - window to processrelativeTo - component used to center windowwidth - new window widthheight - new window heightpublic static <W extends java.awt.Window> W packToWidth(W window,
int width)
W - window typewindow - window to processwidth - new window widthpublic static <W extends java.awt.Window> W packToHeight(W window,
int height)
W - window typewindow - window to processheight - new window heightpublic static <W extends java.awt.Window> W packAndCenter(W window)
W - window typewindow - window to processStyleConstants.animatepublic static <W extends java.awt.Window> W packAndCenter(W window,
boolean animate)
W - window typewindow - window to processanimate - whether should animate window size changes or not