net.ninthtest.swing.util
Class DimensionHelper

java.lang.Object
  extended by net.ninthtest.swing.util.DimensionHelper

public final class DimensionHelper
extends Object

This class provides helper methods for working with AWT Dimensions.

Version:
1.0 $Revision$
Author:
Matthew Zipay (mattz@ninthtest.info)
See Also:
Dimension

Method Summary
static void normalizeHeight(JComponent... components)
          Sets all specified components to the same height.
static void normalizeWidth(JComponent... components)
          Sets all specified components to the same width.
static void setPreferredHeight(int height, JComponent... components)
          Sets all specified components to the same height.
static void setPreferredWidth(int width, JComponent... components)
          Sets all specified components to the same width.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

normalizeWidth

public static final void normalizeWidth(JComponent... components)
Sets all specified components to the same width.

The normalized width is calculated as the maximum preferred width among the specified components.

Parameters:
components - the components to be resized

setPreferredWidth

public static final void setPreferredWidth(int width,
                                           JComponent... components)
Sets all specified components to the same width.

Parameters:
width - the desired width
components - the components to be resized

normalizeHeight

public static final void normalizeHeight(JComponent... components)
Sets all specified components to the same height.

The normalized height is calculated as the maximum preferred height among the specified components.

Parameters:
components - the components to be resized

setPreferredHeight

public static final void setPreferredHeight(int height,
                                            JComponent... components)
Sets all specified components to the same height.

Parameters:
height - the desired height
components - the components to be resized


Copyright © 2010 Matthew Zipay. All Rights Reserved.