|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.swinglib.SwingUtil
public class SwingUtil
A collection of static methods that don't really fit anywhere else.
Constructor Summary | |
---|---|
SwingUtil()
|
Method Summary | |
---|---|
static void |
center(Window window)
Updates the passed window's position to center it with respect to the screen. |
static void |
center(Window window,
Window inWindow)
Updates the first window's position to center it with respect to the second window. |
static void |
centerAndShow(Window window)
Centers the passed window (dialog or frame) on the screen and makes it visible. |
static void |
centerAndShow(Window window,
Window inWindow)
Centers the passed window (dialog or frame) within the second window and makes it visible. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SwingUtil()
Method Detail |
---|
public static void centerAndShow(Window window)
public static void centerAndShow(Window window, Window inWindow)
The second window may be null, in which case the first is centered within the screen. This is a convenience for ownerless dialogs.
public static void center(Window window)
pack()
first!).
Deals with multi-monitor setups via the following hack: if the screen size reported by the default toolkit has a width:height ration > 2:1, then the width is divided by 2. This works well for 1, 2, or 3 screen desktops: the window will appear in the left screen of a 2-screen setup, in the middle of a 3-screen setup.
If the window is larger than the screen size, it's positioned at the top-left corner. Hopefully the user will be able to shrink it.
public static void center(Window window, Window inWindow)
The second window may be null, in which case the first is centered within the screen. This is a convenience for ownerless dialogs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |