Example usage for com.jgoodies.forms.layout FormLayout appendColumn

List of usage examples for com.jgoodies.forms.layout FormLayout appendColumn

Introduction

In this page you can find the example usage for com.jgoodies.forms.layout FormLayout appendColumn.

Prototype

public void appendColumn(ColumnSpec columnSpec) 

Source Link

Document

Appends the given column specification to the right hand side of all columns.

Usage

From source file:org.siberia.ui.swing.dialog.ValidationDialog.java

License:Open Source License

/** build the validation panel according to the size of the content panel **/
private void buildValidationPanel() {
    FormLayout layout = new FormLayout("", "15dlu");

    int maxButton = Math.max(this.valid.getPreferredSize().width, this.annule.getPreferredSize().width);

    int sizeColumn = (int) (this.getContentPanel().getPreferredSize().width - 2 * maxButton) / 3;

    ColumnSpec colSpace = new ColumnSpec(Sizes.pixel(sizeColumn));
    ColumnSpec colButton = new ColumnSpec(Sizes.pixel(maxButton));
    layout.appendColumn(colSpace);
    layout.appendColumn(colButton);/*from   w  ww.  j av a  2  s  . c o m*/
    layout.appendColumn(colSpace);
    layout.appendColumn(colButton);
    layout.appendColumn(colSpace);

    this.validAnnul.setLayout(layout);

    CellConstraints cc = new CellConstraints();
    this.validAnnul.add(this.valid, cc.xy(2, 1, cc.FILL, cc.FILL));
    this.validAnnul.add(this.annule, cc.xy(4, 1, cc.FILL, cc.FILL));
    this.getPanel().add(this.validAnnul, cc.xy(1, 2));
}