Example usage for com.jgoodies.forms.factories CC xy

List of usage examples for com.jgoodies.forms.factories CC xy

Introduction

In this page you can find the example usage for com.jgoodies.forms.factories CC xy.

Prototype

public static CellConstraints xy(int col, int row, String encodedAlignments) 

Source Link

Document

Sets column and row origins; sets width and height to 1; decodes horizontal and vertical alignments from the given string.

Examples:

 CC.xy(1, 3, "left, bottom"); CC.xy(1, 3, "l, b"); CC.xy(1, 3, "center, fill"); CC.xy(1, 3, "c, f"); 

Usage

From source file:edu.udo.scaffoldhunter.gui.dataimport.ImportDialog.java

License:Open Source License

private JPanel buildDatasetNamePanel() {
    PanelBuilder builder = new PanelBuilder(
            new FormLayout("p,3dlu, p:g(0.5),10dlu,p,3dlu,p:g(1.0)", "max(p;60dlu)"));

    builder.addLabel(_("DataImport.DatasetName"));
    builder.nextColumn(2);//from ww w  . ja  va2  s  .  c  o  m
    datasetName = new JTextField();
    datasetName.setDocument(importProcess.getDatasetNameDocument());
    datasetName.getDocument().addDocumentListener(this);
    datasetName.setColumns(20);
    SelectAllOnFocus.addTo(datasetName);
    builder.add(datasetName);
    builder.nextColumn(2);
    builder.addLabel(_("DataImport.DatasetDescription"));
    builder.nextColumn(2);
    datasetDescription = new JTextArea(importProcess.getDatasetDescriptionDocument());
    datasetDescription.setLineWrap(true);
    /*
     * set preferredSize und minimumSize explicitly. Otherwise the textarea
     * will grow but won't shrink again as the preferred size would have
     * grown
     */
    JScrollPane p = new JScrollPane(datasetDescription);
    p.setMinimumSize(p.getMinimumSize());
    p.setPreferredSize(p.getPreferredSize());
    builder.add(p, CC.xy(7, 1, "f, f"));

    return builder.getPanel();
}