FileDocCategorySizeDatePackage
UtilGUI.javaAPI DocExample914Sat Jul 12 19:28:02 BST 2003com.darwinsys.swingui

UtilGUI

public class UtilGUI extends Object
Utilities for GUI work.
version
$Id: UtilGUI.java,v 1.6 2003/07/12 23:28:01 ian Exp $

Fields Summary
Constructors Summary
Methods Summary
public static voidcenter(java.awt.Window w)
Center a Window, Frame, JFrame, Dialog, etc., but do it the American Spelling Way :-)

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

		// After packing a Frame or Dialog, centre it on the screen.
		Dimension us = w.getSize(), 
			them = Toolkit.getDefaultToolkit().getScreenSize();
		int newX = (them.width - us.width) / 2;
		int newY = (them.height- us.height)/ 2;
		w.setLocation(newX, newY);
	
public static voidmaximize(java.awt.Window w)
Maximize a window, the hard way.

		Dimension us = w.getSize(),
			them = Toolkit.getDefaultToolkit().getScreenSize();
		w.setBounds(0,0, them.width, them.height);