Java 6 SE Platform
6.0
Home

com.woven_media.colorsafe
Class WindowUtil

java.lang.Object
  extended by com.woven_media.colorsafe.WindowUtil

public class WindowUtil
extends java.lang.Object

WinUtil is a static utilities class for common window operations.

Since:
1.0

Constructor Summary
WindowUtil()
           
 
Method Summary
static java.awt.Dimension centerWindow(java.awt.Window parent, java.awt.Window child)
          Centers window locations within its parent object.
static java.lang.String getClassName(java.lang.Object o)
          Returns just the class name -- no package info.
static void printExceptionError(java.lang.Throwable cause, java.lang.String msg, boolean seperator)
          Prints an exception cause message and accepts a flag to indicate whether to print a seperator of form \n---------- STACK TRACE OUTPUT ----------\n
static void setClassicLookAndFeel()
          Tell system to use Windows Classic LAF.
static void setJavaLookAndFeel()
          Tell system to use Metal (Java) LAF.
static void setLookAndFeelByClassName(java.lang.String className)
          Attempts to set this LAF by passing className as a string parameter and calling the UIManager#setLookAndFeel method.
static void setMotifLookAndFeel()
          Tell system to use Motif LAF.
static void setNativeLookAndFeel()
          Tell system to use native look and feel, as in previous releases.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WindowUtil

public WindowUtil()
Method Detail

centerWindow

public static java.awt.Dimension centerWindow(java.awt.Window parent,
                                              java.awt.Window child)
Centers window locations within its parent object. Passing null to parent parameter centers window within the screen, otherwise the child window is centered within the parent window. centerWindow returns if child parameter is passed as a null value.

Parameters:
parent - reference to the parent window.
child - reference to child window.
Returns:
java.util.Dimension object.
Since:
1.0

getClassName

public static java.lang.String getClassName(java.lang.Object o)
Returns just the class name -- no package info.

Returns:
java.lang.String of the class name minus package information.
Since:
1.0

setLookAndFeelByClassName

public static void setLookAndFeelByClassName(java.lang.String className)
                                      throws java.lang.Exception
Attempts to set this LAF by passing className as a string parameter and calling the UIManager#setLookAndFeel method.

Parameters:
className - java.lang.String of a valid javax.swing.LookAndFeel class.
Throws:
java.lang.Exception
Since:
1.0
See Also:
ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException

printExceptionError

public static void printExceptionError(java.lang.Throwable cause,
                                       java.lang.String msg,
                                       boolean seperator)
Prints an exception cause message and accepts a flag to indicate whether to print a seperator of form \n---------- STACK TRACE OUTPUT ----------\n

Parameters:
cause - java.lang.Exception#cause message.
msg - java.lang.Exception#message message.
seperator - indicates whether to print the stack trace output seperator.

setNativeLookAndFeel

public static void setNativeLookAndFeel()
Tell system to use native look and feel, as in previous releases. Metal (Java) Look and Feel (LAF) is the default otherwise.

Since:
1.0
See Also:
UIManager

setClassicLookAndFeel

public static void setClassicLookAndFeel()
Tell system to use Windows Classic LAF.

Since:
1.0

setJavaLookAndFeel

public static void setJavaLookAndFeel()
Tell system to use Metal (Java) LAF.

Since:
1.0

setMotifLookAndFeel

public static void setMotifLookAndFeel()
Tell system to use Motif LAF.

Since:
1.0
See Also:
setLookAndFeelByClassName(java.lang.String)

Java 6 SE Platform
6.0
Home

JavaDoc API documentation written, prepared and compiled by Brent Allen Parrish, woven-media.com, 20 SEPT 2009