de.pxclass.gui
Class GUIUtils

java.lang.Object
  extended by de.pxclass.gui.GUIUtils

public class GUIUtils
extends java.lang.Object

A helper class for programming GUIs.

Since:
0.9
Version:
$Revision: 71 $
Author:
D. Starke

Constructor Summary
GUIUtils()
           
 
Method Summary
static void setMaxSizeRelatively(javax.swing.JComponent comp, double xFactor, double yFactor)
          Sets the maximum size of the specified component relatively to its preferred size.
static void setMinSizeRelatively(javax.swing.JComponent comp, double xFactor, double yFactor)
          Sets the minimum size of the specified component relatively to its preferred size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GUIUtils

public GUIUtils()
Method Detail

setMinSizeRelatively

public static void setMinSizeRelatively(javax.swing.JComponent comp,
                                        double xFactor,
                                        double yFactor)
Sets the minimum size of the specified component relatively to its preferred size.

Example:
To get textField1 having a minimum width half of its preferred width:
  GUIUtils.setMinSizeRelatively(textField1, 0.5, 1.0)

Parameters:
comp - the component whose minimum size should be set relatively to its preferred size
xFactor - the factor to apply to the width
yFactor - the factor to apply to the height

setMaxSizeRelatively

public static void setMaxSizeRelatively(javax.swing.JComponent comp,
                                        double xFactor,
                                        double yFactor)
Sets the maximum size of the specified component relatively to its preferred size.

Example:
To get textField1 having a maximum width double of its preferred width:
  GUIUtils.setMaxSizeRelatively(textField1, 2.0, 1.0)

Parameters:
comp - the component whose maximum size should be set relatively to its preferred size
xFactor - the factor to apply to the width
yFactor - the factor to apply to the height


Copyright © 2008. All Rights Reserved.