|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.pxclass.gui.GUIUtils
public class GUIUtils
A helper class for programming GUIs.
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 |
---|
public GUIUtils()
Method Detail |
---|
public static void setMinSizeRelatively(javax.swing.JComponent comp, double xFactor, double yFactor)
Example:
To get textField1
having a minimum width half of its
preferred width:
GUIUtils.setMinSizeRelatively(textField1, 0.5, 1.0)
comp
- the component whose minimum size should be set relatively to
its preferred sizexFactor
- the factor to apply to the widthyFactor
- the factor to apply to the heightpublic static void setMaxSizeRelatively(javax.swing.JComponent comp, double xFactor, double yFactor)
Example:
To get textField1
having a maximum width double of its
preferred width:
GUIUtils.setMaxSizeRelatively(textField1, 2.0, 1.0)
comp
- the component whose maximum size should be set relatively to
its preferred sizexFactor
- the factor to apply to the widthyFactor
- the factor to apply to the height
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |