com.darwinsys.swingui
Class UtilGUI

java.lang.Object
  extended by com.darwinsys.swingui.UtilGUI

public class UtilGUI
extends java.lang.Object

Utilities for GUI work.

Version:
$Id: UtilGUI.java,v 1.10 2006/06/27 01:17:06 ian Exp $

Constructor Summary
UtilGUI()
           
 
Method Summary
static void center(java.awt.Window w)
          Center a Window, Frame, JFrame, Dialog, etc., but do it the American Spelling Way :-)
static void centre(java.awt.Window w)
          Centre a Window, Frame, JFrame, Dialog, etc.
static boolean confirm(javax.swing.JFrame parent, java.lang.String message)
          Print a yes/no prompt; return true if the user presses yes
static java.awt.Point getSavedLocation(java.util.prefs.Preferences pNode)
          Retrieve the saved X and Y from Preferences
static void maximize(java.awt.Window w)
          Maximize a window, the hard way.
static void monitorWindowPosition(java.awt.Window w, java.util.prefs.Preferences pNode)
          Track a Window's position across application restarts; location is saved in a Preferences node that you pass in; we attach a ComponentListener to the Window.
static void setSavedLocation(java.util.prefs.Preferences pNode, java.awt.Window w)
          Save the X and Y locations in Preferences node provided.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UtilGUI

public UtilGUI()
Method Detail

centre

public static void centre(java.awt.Window w)
Centre a Window, Frame, JFrame, Dialog, etc.


center

public static void center(java.awt.Window w)
Center a Window, Frame, JFrame, Dialog, etc., but do it the American Spelling Way :-)


maximize

public static void maximize(java.awt.Window w)
Maximize a window, the hard way.


confirm

public static boolean confirm(javax.swing.JFrame parent,
                              java.lang.String message)
Print a yes/no prompt; return true if the user presses yes


setSavedLocation

public static void setSavedLocation(java.util.prefs.Preferences pNode,
                                    java.awt.Window w)
Save the X and Y locations in Preferences node provided.


getSavedLocation

public static java.awt.Point getSavedLocation(java.util.prefs.Preferences pNode)
Retrieve the saved X and Y from Preferences


monitorWindowPosition

public static void monitorWindowPosition(java.awt.Window w,
                                         java.util.prefs.Preferences pNode)
Track a Window's position across application restarts; location is saved in a Preferences node that you pass in; we attach a ComponentListener to the Window.



Copyright © 1996-2004 Ian F. Darwin. See license.html for usage license.