use of com.jgoodies.forms.layout.FormLayout in project jgnash by ccavanaugh.
the class TransactionNumberDialog method layoutDialog.
private void layoutDialog() {
final FormLayout layout = new FormLayout("p:g", "f:p:g(1.0)");
final DefaultFormBuilder builder = new DefaultFormBuilder(layout);
builder.border(Borders.DIALOG);
builder.append(layoutPanel());
builder.nextLine();
builder.appendUnrelatedComponentsGapRow();
builder.nextLine();
builder.append(StaticUIMethods.buildOKCancelBar(okButton, cancelButton));
getContentPane().add(builder.getPanel(), BorderLayout.CENTER);
pack();
setMinimumSize(getSize());
}
use of com.jgoodies.forms.layout.FormLayout in project jgnash by ccavanaugh.
the class AbstractTransactionPanel method buildHorizontalSubPanel.
/**
* A method to help create one row sub panels. This helps to work around
* a layout limitation of components spanning multiple columns.
* If a String is passed as a component, it will be localized and
* converted to a JLabel.
*
* @param columnSpec The column spec for the layout
* @param components The components for the sub-panel
* @return The resulting JPanel
*/
protected JPanel buildHorizontalSubPanel(final String columnSpec, final Object... components) {
FormLayout layout = new FormLayout(columnSpec, "f:d:g");
DefaultFormBuilder builder = new DefaultFormBuilder(layout);
for (Object component1 : components) {
if (component1 instanceof String) {
// add a label
builder.append(new JLabel(rb.getString((String) component1)));
} else {
// add a component
builder.append((Component) component1);
}
}
return builder.getPanel();
}
use of com.jgoodies.forms.layout.FormLayout in project jgnash by ccavanaugh.
the class AccountExchangePanel method removeExtraComponents.
private void removeExtraComponents() {
FormLayout layout = (FormLayout) getLayout();
remove(expandButton);
remove(exchangeAmountField);
remove(amountLabel);
layout.removeColumn(7);
layout.removeColumn(6);
layout.removeColumn(5);
layout.removeColumn(4);
layout.removeColumn(3);
layout.removeColumn(2);
invalidate();
isLayoutCompact = true;
}
use of com.jgoodies.forms.layout.FormLayout in project jgnash by ccavanaugh.
the class AccountExchangePanel method layoutPanel.
private void layoutPanel() {
FormLayout layout = new FormLayout("50dlu:g", "f:d:g");
CellConstraints cc = new CellConstraints();
setLayout(layout);
add(accountCombo, cc.xy(1, 1));
isLayoutCompact = true;
}
use of com.jgoodies.forms.layout.FormLayout in project jgnash by ccavanaugh.
the class AccountExchangePanel method addExtraComponents.
private void addExtraComponents() {
FormLayout layout = (FormLayout) getLayout();
// col 2
layout.appendColumn(ColumnSpec.decode("8dlu"));
layout.appendColumn(ColumnSpec.decode("right:d"));
layout.appendColumn(ColumnSpec.decode("$lcgap"));
layout.appendColumn(ColumnSpec.decode("max(48dlu;min)"));
// col 6
layout.appendColumn(ColumnSpec.decode("1px"));
// col 7
layout.appendColumn(ColumnSpec.decode("min"));
CellConstraints cc = new CellConstraints();
add(amountLabel, cc.xy(3, 1));
add(exchangeAmountField, cc.xy(5, 1));
add(expandButton, cc.xy(7, 1));
invalidate();
isLayoutCompact = false;
}
Aggregations