|
Venice 0.7beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mov.ui.GridBagHelper
public class GridBagHelper
GridBagHelper is a class that makes it easier to create form user interfaces. Using GridBagLayout and this class you can easily create forms, reducing code repeitition. For example to create a form which lets the user fill in two text field entries:
JPanel formPanel = new JPanel(); GridBagLayout gridbag = new GridBagLayout(); GridBagConstraints c = new GridBagConstraints(); formPanel.setLayout(gridbag); c.weightx = 1.0; c.ipadx = 5; c.anchor = GridBagConstraints.WEST; JTextField initialCapitalTextField = GridBagHelper.addTextRow(formPanel, "Initial Capital", "", gridbag, c, 10); JTextField tradeCostTextField = GridBagHelper.addTextRow(formPanel, "Trade Cost", "", gridbag, c, 5);
Method Summary | |
---|---|
static javax.swing.JCheckBox |
addCheckBoxRow(javax.swing.JPanel panel,
java.lang.String field,
boolean isSelected,
java.awt.GridBagLayout gridbag,
java.awt.GridBagConstraints c)
Append a new row containing a check box button to the form. |
static javax.swing.JComboBox |
addComboBox(javax.swing.JPanel panel,
java.lang.String field,
java.util.Vector list,
java.awt.GridBagLayout gridbag,
java.awt.GridBagConstraints c)
Append a new list combo box to the form. |
static ExpressionComboBox |
addExpressionRow(javax.swing.JPanel panel,
java.lang.String field,
java.lang.String value,
java.awt.GridBagLayout gridbag,
java.awt.GridBagConstraints c)
Append a new row containing an expression combo box button to the form. |
static javax.swing.JLabel |
addLabelRow(javax.swing.JPanel panel,
java.lang.String field,
java.lang.String labelText,
java.awt.GridBagLayout gridbag,
java.awt.GridBagConstraints c)
Append a new row containing a label field to the form. |
static javax.swing.JPasswordField |
addPasswordRow(javax.swing.JPanel panel,
java.lang.String field,
java.lang.String value,
java.awt.GridBagLayout gridbag,
java.awt.GridBagConstraints c,
int length)
Append a new row containing a password text field to the form. |
static SymbolListComboBox |
addSymbolListComboBox(javax.swing.JPanel panel,
java.lang.String field,
java.lang.String symbolList,
java.awt.GridBagLayout gridbag,
java.awt.GridBagConstraints c)
Append a new symbol list combo box to the form. |
static javax.swing.JTextField |
addTextRow(javax.swing.JPanel panel,
java.lang.String field,
java.lang.String value,
java.awt.GridBagLayout gridbag,
java.awt.GridBagConstraints c,
int length)
Append a new row containing a text field to the form. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static javax.swing.JCheckBox addCheckBoxRow(javax.swing.JPanel panel, java.lang.String field, boolean isSelected, java.awt.GridBagLayout gridbag, java.awt.GridBagConstraints c)
panel
- form panelfield
- text to display next to check boxisSelected
- is the check box currently selected?gridbag
- the form's gridbagc
- the form's constraints
public static ExpressionComboBox addExpressionRow(javax.swing.JPanel panel, java.lang.String field, java.lang.String value, java.awt.GridBagLayout gridbag, java.awt.GridBagConstraints c)
panel
- form panelfield
- text to display next to expression combo boxvalue
- initial value of combo boxgridbag
- the form's gridbagc
- the form's constraints
public static javax.swing.JPasswordField addPasswordRow(javax.swing.JPanel panel, java.lang.String field, java.lang.String value, java.awt.GridBagLayout gridbag, java.awt.GridBagConstraints c, int length)
panel
- form panelfield
- text to display next to password text fieldvalue
- initial value of password text fieldgridbag
- the form's gridbagc
- the form's constraintslength
- the length of the text field
public static javax.swing.JTextField addTextRow(javax.swing.JPanel panel, java.lang.String field, java.lang.String value, java.awt.GridBagLayout gridbag, java.awt.GridBagConstraints c, int length)
panel
- form panelfield
- text to display next to text fieldvalue
- initial value of text fieldgridbag
- the form's gridbagc
- the form's constraintslength
- the length of text field
public static javax.swing.JLabel addLabelRow(javax.swing.JPanel panel, java.lang.String field, java.lang.String labelText, java.awt.GridBagLayout gridbag, java.awt.GridBagConstraints c)
panel
- form panelfield
- text to display next to the label fieldlabelText
- label textgridbag
- the form's gridbagc
- the form's constraints
public static SymbolListComboBox addSymbolListComboBox(javax.swing.JPanel panel, java.lang.String field, java.lang.String symbolList, java.awt.GridBagLayout gridbag, java.awt.GridBagConstraints c)
panel
- form panelfield
- text to display next to the combo boxsymbolList
- initial symbol listgridbag
- the form's gridbagc
- the form's constraints
public static javax.swing.JComboBox addComboBox(javax.swing.JPanel panel, java.lang.String field, java.util.Vector list, java.awt.GridBagLayout gridbag, java.awt.GridBagConstraints c)
panel
- form panelfield
- text to display next to the combo boxgridbag
- the form's gridbagc
- the form's constraints
|
Venice 0.7beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |