HOME

com.ultraswing
Class SwingUtil

java.lang.Object
  extended bycom.ultraswing.SwingUtil

public final class SwingUtil
extends Object

A collection of helper methods.


Constructor Summary
SwingUtil()
           
 
Method Summary
static void centerOnFrame(Frame frame, Component comp)
          Centers the component on the frame.
static void centerOnScreen(Component comp)
          Centers the component on the screen.
static Border createInactiveBorder()
          Creates a border with a flat edge
static Border createLoweredBorder()
          Creates a border with a lowered edge
static Border createOneSidedBorder(int[] sides, int insets)
           
static Border createRaisedBorder()
          Creates a border with a raised edge
static Point getCenter(Component f, Dimension size)
          Return the central point
static ImageIcon getRolloverImage(Image img)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwingUtil

public SwingUtil()
Method Detail

getCenter

public static Point getCenter(Component f,
                              Dimension size)
Return the central point

Parameters:
f - parent component, such as frame
size - the size of the new component

centerOnScreen

public static void centerOnScreen(Component comp)
Centers the component on the screen. It's recommended to be invoked before component is visible.


centerOnFrame

public static void centerOnFrame(Frame frame,
                                 Component comp)
Centers the component on the frame. It's recommended to be invoked before component is visible.


createRaisedBorder

public static Border createRaisedBorder()
Creates a border with a raised edge


createLoweredBorder

public static Border createLoweredBorder()
Creates a border with a lowered edge


createInactiveBorder

public static Border createInactiveBorder()
Creates a border with a flat edge


getRolloverImage

public static ImageIcon getRolloverImage(Image img)

createOneSidedBorder

public static Border createOneSidedBorder(int[] sides,
                                          int insets)

HOME

Copyright © 2002 iReasoning Inc. All Rights Reserved.