private void layoutMainPanel() {
    FormLayout layout =
        new FormLayout(
            "right:d, $lcgap, 50dlu:g, 8dlu, right:d, $lcgap, max(65dlu;min)",
            "f:d, $nlgap, f:d, $nlgap, f:d");

    layout.setRowGroups(new int[][] {{1, 3, 5}});
    CellConstraints cc = new CellConstraints();

    setLayout(layout);

    /* Create a sub panel to work around a column spanning problem in FormLayout */
    JPanel subPanel =
        buildHorizontalSubPanel(
            "max(48dlu;min):g(0.5), 8dlu, d, $lcgap, max(48dlu;min):g(0.5)",
            ValidationFactory.wrap(priceField),
            "Label.Quantity",
            ValidationFactory.wrap(quantityField));

    add("Label.Security", cc.xy(1, 1));
    add(ValidationFactory.wrap(securityCombo), cc.xy(3, 1));
    add("Label.Date", cc.xy(5, 1));
    add(datePanel, cc.xy(7, 1));

    add("Label.Price", cc.xy(1, 3));
    add(subPanel, cc.xy(3, 3));
    add("Label.Total", cc.xy(5, 3));
    add(totalField, cc.xy(7, 3));

    add("Label.Memo", cc.xy(1, 5));
    add(memoField, cc.xy(3, 5));
    add(getReconcileCheckBox(), cc.xyw(5, 5, 3));
  }
Esempio n. 2
0
  private void layoutMainPanel() {
    FormLayout layout =
        new FormLayout(
            "right:d, $lcgap, 50dlu:g, 8dlu, right:d, $lcgap, max(48dlu;min)",
            "f:d, $nlgap, f:d, $nlgap, f:d, $nlgap, f:d");

    layout.setRowGroups(new int[][] {{1, 3, 5, 7}});
    CellConstraints cc = new CellConstraints();

    setLayout(layout);
    setBorder(Borders.DIALOG_BORDER);

    add("Label.TransferTo", cc.xy(1, 1));
    add(accountPanel, cc.xy(3, 1));
    add("Label.Date", cc.xy(5, 1));
    add(datePanel, cc.xy(7, 1));

    add("Label.Memo", cc.xy(1, 3));
    add(memoField, cc.xy(3, 3));
    add("Label.Amount", cc.xy(5, 3));
    add(ValidationFactory.wrap(amountField), cc.xy(7, 3));

    add(createBottomPanel(), cc.xyw(1, 7, 7));
  }