Search in sources :

Example 1 with PanelBuilder

use of com.jgoodies.forms.builder.PanelBuilder in project jgnash by ccavanaugh.

the class RecurringEntryDialog method layoutMainPanel.

private void layoutMainPanel() {
    FormLayout layout = new FormLayout("10dlu, p:g", "p, 3dlu, f:p:g, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 6dlu, p");
    PanelBuilder builder = new PanelBuilder(layout);
    CellConstraints cc = new CellConstraints();
    okButton = new JButton(rb.getString("Button.Ok"));
    cancelButton = new JButton(rb.getString("Button.Cancel"));
    builder.border(Borders.DIALOG);
    builder.addSeparator(rb.getString("Title.Transaction"), cc.xyw(1, 1, 2));
    builder.add(createTransactionPanel(), cc.xy(2, 3));
    builder.addSeparator(rb.getString("Title.Frequency"), cc.xyw(1, 5, 2));
    builder.add(createFreqPanel(), cc.xy(2, 7));
    builder.addSeparator(rb.getString("Title.Entry"), cc.xyw(1, 9, 2));
    builder.add(createEntryPanel(), cc.xy(2, 11));
    builder.add(StaticUIMethods.buildOKCancelBar(okButton, cancelButton), cc.xy(2, 13));
    getContentPane().add(builder.getPanel(), BorderLayout.CENTER);
    pack();
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) PanelBuilder(com.jgoodies.forms.builder.PanelBuilder) JButton(javax.swing.JButton) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Example 2 with PanelBuilder

use of com.jgoodies.forms.builder.PanelBuilder in project jgnash by ccavanaugh.

the class BudgetPanel method layoutMainPanel.

private void layoutMainPanel() {
    initComponents();
    FormLayout layout = new FormLayout("fill:p:g, 5dlu", "d, $rg, d, f:p:g, 5dlu");
    PanelBuilder builder = new PanelBuilder(layout, this);
    CellConstraints cc = new CellConstraints();
    JToolBar toolBar = new JToolBar();
    toolBar.setFloatable(false);
    toolBar.setRollover(true);
    toolBar.add(budgetCombo);
    toolBar.add(budgetPropertiesButton);
    toolBar.addSeparator();
    toolBar.add(budgetManagerButton);
    toolBar.addSeparator();
    toolBar.add(summaryRowVisibleCheckBox);
    toolBar.add(summaryColVisibleCheckBox);
    toolBar.addSeparator();
    toolBar.add(budgetExportButton);
    builder.add(toolBar, cc.xyw(1, 1, 2));
    scrollPane = new JideScrollPane();
    // force it something small so it will resize correctly
    scrollPane.setPreferredSize(new Dimension(1, 1));
    scrollPane.setColumnHeadersHeightUnified(true);
    rowHeaderResizeHandler = new AccountRowHeaderResizeHandler(scrollPane);
    overviewPanel = new BudgetOverviewPanel(this);
    add(overviewPanel, cc.xyw(1, 3, 2));
    add(scrollPane, cc.xy(1, 4));
    // listen for budget events
    MessageBus.getInstance().registerListener(this, MessageChannel.BUDGET);
    MessageBus.getInstance().registerListener(this, MessageChannel.SYSTEM);
    if (budgetCombo.getSelectedBudget() != null) {
        showBudgetPane();
    }
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) PanelBuilder(com.jgoodies.forms.builder.PanelBuilder) JideScrollPane(com.jidesoft.swing.JideScrollPane) JToolBar(javax.swing.JToolBar) Dimension(java.awt.Dimension) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Aggregations

PanelBuilder (com.jgoodies.forms.builder.PanelBuilder)2 CellConstraints (com.jgoodies.forms.layout.CellConstraints)2 FormLayout (com.jgoodies.forms.layout.FormLayout)2 JideScrollPane (com.jidesoft.swing.JideScrollPane)1 Dimension (java.awt.Dimension)1 JButton (javax.swing.JButton)1 JToolBar (javax.swing.JToolBar)1