List of usage examples for com.jgoodies.forms.layout FormLayout addGroupedColumn
public void addGroupedColumn(int columnIndex)
From source file:brainflow.colormap.ColorIntervalEditor.java
private void setupLayout() { FormLayout layout = new FormLayout( "2dlu, l:max(p;25dlu), 5dlu, max(p;15dlu), 5dlu, max(p;15dlu), 5dlu, max(p;15dlu), 5dlu, max(p;15dlu), 2dlu", "2dlu, p, 4dlu, p, 4dlu, p, 2dlu"); layout.addGroupedColumn(4); layout.addGroupedColumn(6);/* w ww. ja va 2 s . co m*/ layout.addGroupedColumn(8); layout.addGroupedColumn(10); setLayout(layout); CellConstraints cc = new CellConstraints(); JLabel redLabel = new JLabel("R"); redLabel.setToolTipText("Red"); add(redLabel, cc.xy(4, 2)); JLabel greenLabel = new JLabel("G"); greenLabel.setToolTipText("Green"); add(greenLabel, cc.xy(6, 2)); JLabel blueLabel = new JLabel("B"); blueLabel.setToolTipText("Blue"); add(blueLabel, cc.xy(8, 2)); JLabel alphaLabel = new JLabel("A"); alphaLabel.setToolTipText("Alpha/Opacity"); add(alphaLabel, cc.xy(10, 2)); add(new JideButton(colorIcon), cc.xy(2, 4)); add(new JLabel(" Range: "), cc.xy(2, 6)); add(new JLabel("" + interval.getRed()), cc.xy(4, 4)); add(new JLabel("" + interval.getGreen()), cc.xy(6, 4)); add(new JLabel("" + interval.getBlue()), cc.xy(8, 4)); add(new JLabel("" + interval.getAlpha()), cc.xy(10, 4)); NumberFormat format = DecimalFormat.getNumberInstance(); format.setMaximumFractionDigits(2); lowField = new JFormattedTextField(format); highField = new JFormattedTextField(format); lowField.setValue(interval.getMinimum()); highField.setValue(interval.getMaximum()); if (!isEditable) { lowField.setEditable(false); highField.setEditable(false); } add(lowField, cc.xywh(4, 6, 3, 1)); //add(new JLabel(JideIconsFactory.getImageIcon(JideIconsFactory.Arrow.RIGHT)), cc.xy(6,6)); add(highField, cc.xywh(8, 6, 3, 1)); }
From source file:jgnash.ui.commodity.CurrenciesPanel.java
License:Open Source License
private void layoutMainPanel() { initComponents();/*from w w w .ja v a2 s. c o m*/ FormLayout layout = new FormLayout("d:g(0.5), 8dlu, p, 8dlu, d:g(0.5)", ""); layout.addGroupedColumn(1); layout.addGroupedColumn(5); DefaultFormBuilder builder = new DefaultFormBuilder(layout, this); builder.appendTitle(rb.getString("Title.Available")); builder.append(""); builder.appendTitle(rb.getString("Title.Current")); builder.nextLine(); builder.appendRelatedComponentsGapRow(); builder.nextLine(); builder.appendRow("fill:80dlu:g"); builder.append(new JScrollPane(aJList), buildCenterPanel(), new JScrollPane(cJList)); builder.nextLine(); builder.appendUnrelatedComponentsGapRow(); builder.nextLine(); builder.append(layoutCustomPanel(), 5); builder.appendSeparator(); }
From source file:jgnash.ui.reconcile.ReconcileDialog.java
License:Open Source License
private void layoutMainPanel() { initComponents();/* w w w . ja v a 2 s . c o m*/ FormLayout layout = new FormLayout("min:grow(0.5), 7dlu, min:grow(0.5)", "fill:min:g, 7dlu, p, 14dlu, p"); layout.addGroupedColumn(1); layout.addGroupedColumn(3); CellConstraints cc = new CellConstraints(); String[] columnNames = RegisterFactory.getCreditDebitTabNames(account); FormLayout dLayout = new FormLayout("fill:min:g(1.0)", "fill:min:g, 4dlu, p"); JPanel dPanel = new JPanel(dLayout); dPanel.add(buildTablePanel(columnNames[1], debitTotalLabel, debitTable), cc.xy(1, 1)); dPanel.add(ButtonBarFactory.buildLeftAlignedBar(debitSelectAllButton, debitClearAllButton), cc.xy(1, 3)); FormLayout cLayout = new FormLayout("fill:min:g(1.0)", "fill:min:g, 4dlu, p"); JPanel cPanel = new JPanel(cLayout); cPanel.add(buildTablePanel(columnNames[0], creditTotalLabel, creditTable), cc.xy(1, 1)); cPanel.add(ButtonBarFactory.buildLeftAlignedBar(creditSelectAllButton, creditClearAllButton), cc.xy(1, 3)); JPanel p = new JPanel(layout); p.setBorder(Borders.DIALOG_BORDER); p.add(dPanel, cc.xywh(1, 1, 1, 3)); p.add(cPanel, cc.xy(3, 1)); p.add(buildStatPanel(), cc.xy(3, 3)); p.add(ButtonBarFactory.buildRightAlignedBar(cancelButton, finishLaterButton, finishButton), cc.xywh(1, 5, 3, 1)); getContentPane().add(p); pack(); setMinimumSize(getSize()); DialogUtils.addBoundsListener(this); // this will size and locate the dialog }