Order the Book

coreservlets
Class WindowUtilities

java.lang.Object
  |
  +--coreservlets.WindowUtilities

public class WindowUtilities
extends Object

A few utilities that simplify using windows in Swing.

Taken from Core Servlets and JavaServer Pages from Prentice Hall and Sun Microsystems Press, http://www.coreservlets.com/. © 2000 Marty Hall; may be freely used or adapted.


Constructor Summary
WindowUtilities()
           
 
Method Summary
static JFrame openInJFrame(Container content, int width, int height)
          Uses Color.white as the background color, and the name of the Container's class as the JFrame title.
static JFrame openInJFrame(Container content, int width, int height, String title)
          Uses Color.white as the background color.
static JFrame openInJFrame(Container content, int width, int height, String title, Color bgColor)
          A simplified way to see a JPanel or other Container.
static void setJavaLookAndFeel()
           
static void setMotifLookAndFeel()
           
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

WindowUtilities

public WindowUtilities()
Method Detail

setNativeLookAndFeel

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

setJavaLookAndFeel

public static void setJavaLookAndFeel()

setMotifLookAndFeel

public static void setMotifLookAndFeel()

openInJFrame

public static JFrame openInJFrame(Container content,
                                  int width,
                                  int height,
                                  String title,
                                  Color bgColor)
A simplified way to see a JPanel or other Container. Pops up a JFrame with specified Container as the content pane.

openInJFrame

public static JFrame openInJFrame(Container content,
                                  int width,
                                  int height,
                                  String title)
Uses Color.white as the background color.

openInJFrame

public static JFrame openInJFrame(Container content,
                                  int width,
                                  int height)
Uses Color.white as the background color, and the name of the Container's class as the JFrame title.

Order the Book

Order
CSAJSP @ amazon.com

Return to Top-Level Source Code Archive