public class WindowUtil
extends java.lang.Object
| Constructor and Description |
|---|
WindowUtil() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
applyGeometry(java.awt.Frame frame,
java.lang.String geometry)
Assigns position and size to a desktop frame from a textual
geometry definition.
|
static java.awt.Rectangle |
parseGeometry(java.lang.String geometry)
Parses a geometry string made up of positional parameters
"width height xpos ypos" or "xpos ypos" (ie.
|
public static boolean applyGeometry(java.awt.Frame frame,
java.lang.String geometry)
parseGeometry(String).
If geometry is null or cannot be understood, this call
will do nothing and return false.frame - - a desktop frame to position and sizegeometry - - a geometry definition stringpublic static java.awt.Rectangle parseGeometry(java.lang.String geometry)
throws java.lang.IllegalArgumentException
Examples:
This method throws IllegalArgumentException if the geometry string is invalid.
Using this method and catching that exception provides a simple way of testing a geometry
string before use, e.g. when you are parsing command-line arguments.
The returned rectangle will contain 0 for any coordinate that was
not defined in the geometry string. This can happen for strings specified in
"X server short notation" (where only x and y are defined), and for strings
specified in "named parameters" notation (if parameters were omitted).
geometry - - the geometry as textjava.lang.IllegalArgumentException - if the argument is null or cannot be parsed