Search in sources :

Example 86 with JTabbedPane

use of javax.swing.JTabbedPane in project jgnash by ccavanaugh.

the class RecurringEntryDialog method createFreqPanel.

private JPanel createFreqPanel() {
    FormLayout layout = new FormLayout("right:p, 4dlu, max(48dlu;min), 6dlu, p, f:p:g", "f:p, 3dlu, min");
    CellConstraints cc = new CellConstraints();
    JPanel p = new JPanel(layout);
    startDateField = new DatePanel();
    enabledCheckBox = new JCheckBox(rb.getString("Button.Enabled"));
    freqTab = new JTabbedPane();
    freqTab.add(rb.getString("Tab.None"), new NoneTab());
    freqTab.add(rb.getString("Tab.Day"), new DayTab());
    freqTab.add(rb.getString("Tab.Week"), new WeekTab());
    freqTab.add(rb.getString("Tab.Month"), new MonthTab());
    freqTab.add(rb.getString("Tab.Year"), new YearTab());
    tabMap.put(OneTimeReminder.class, 0);
    tabMap.put(DailyReminder.class, 1);
    tabMap.put(WeeklyReminder.class, 2);
    tabMap.put(MonthlyReminder.class, 3);
    tabMap.put(YearlyReminder.class, 4);
    p.add(new JLabel(rb.getString("Label.FirstPayDate")), cc.xy(1, 1));
    p.add(startDateField, cc.xy(3, 1));
    p.add(enabledCheckBox, cc.xy(5, 1));
    p.add(freqTab, cc.xywh(1, 3, 6, 1));
    return p;
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) DatePanel(jgnash.ui.components.DatePanel) JTabbedPane(javax.swing.JTabbedPane) JLabel(javax.swing.JLabel) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Example 87 with JTabbedPane

use of javax.swing.JTabbedPane in project jgnash by ccavanaugh.

the class SplitsDialog method initComponents.

private void initComponents() {
    newButton = new JButton(rb.getString("Button.New"));
    deleteButton = new JButton(rb.getString("Button.Delete"));
    deleteAllButton = new JButton(rb.getString("Button.DeleteAll"));
    okButton = new JButton(rb.getString("Button.Ok"));
    cancelButton = new JButton(rb.getString("Button.Cancel"));
    concatenateMemoCheckBox = new JCheckBox(rb.getString("Button.ConcatenateMemos"));
    concatenateMemoCheckBox.setSelected(RegisterFactory.getConcatenateMemos());
    okButton.addActionListener(this);
    cancelButton.addActionListener(this);
    newButton.addActionListener(this);
    deleteButton.addActionListener(this);
    deleteAllButton.addActionListener(this);
    tabbedPane = new JTabbedPane();
    debitPanel = new SplitTransactionEntryPanel(model, PanelType.DECREASE);
    creditPanel = new SplitTransactionEntryPanel(model, PanelType.INCREASE);
    String[] tabNames = RegisterFactory.getCreditDebitTabNames(account);
    tabbedPane.add(tabNames[0], creditPanel);
    tabbedPane.add(tabNames[1], debitPanel);
    table.getSelectionModel().addListSelectionListener(this);
    concatenateMemoCheckBox.addActionListener(e -> RegisterFactory.setConcatenateMemos(concatenateMemoCheckBox.isSelected()));
}
Also used : JCheckBox(javax.swing.JCheckBox) JTabbedPane(javax.swing.JTabbedPane) JButton(javax.swing.JButton)

Example 88 with JTabbedPane

use of javax.swing.JTabbedPane in project processdash by dtuma.

the class WBSTabPanel method makeTabbedPane.

/** Create and install the tabbed pane component. */
private void makeTabbedPane() {
    tabbedPane = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
    // Create a "pseudo-tab" that displays the "Add Tab" icon.
    tabbedPane.addTab(null, IconFactory.getAddTabIcon(), new EmptyComponent(new Dimension(10, 10)), "Add New Tab");
    tabbedPane.addChangeListener(new TabListener());
    GridBagConstraints c = new GridBagConstraints();
    c.gridx = c.gridy = 0;
    c.weightx = c.weighty = 1.0;
    c.fill = GridBagConstraints.BOTH;
    c.insets.top = c.insets.bottom = c.insets.right = 0;
    c.insets.left = 215;
    add(tabbedPane);
    setLayer(tabbedPane, 10);
    layout.setConstraints(tabbedPane, c);
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) JTabbedPane(javax.swing.JTabbedPane) Dimension(java.awt.Dimension)

Example 89 with JTabbedPane

use of javax.swing.JTabbedPane in project processdash by dtuma.

the class WBSFindAction method createDialog.

private void createDialog() {
    JPanel panel = new JPanel();
    panel.setBorder(BorderFactory.createEmptyBorder(5, 8, 10, 8));
    GridBagLayout layout = new GridBagLayout();
    panel.setLayout(layout);
    FindPreviousAction findPrevious = new FindPreviousAction();
    findNext = new FindNextAction();
    ReplaceAction replace = new ReplaceAction();
    CancelAction cancel = new CancelAction();
    setKey(panel, KeyEvent.VK_P, InputEvent.ALT_DOWN_MASK, findPrevious);
    setKey(panel, KeyEvent.VK_N, InputEvent.ALT_DOWN_MASK, findNext);
    setKey(panel, KeyEvent.VK_R, InputEvent.ALT_DOWN_MASK, replace);
    setKey(panel, KeyEvent.VK_ESCAPE, 0, cancel);
    GridBagConstraints lc = new GridBagConstraints();
    lc.gridx = lc.gridy = 0;
    lc.gridwidth = 2;
    lc.anchor = GridBagConstraints.WEST;
    lc.insets = new Insets(33, 12, 5, 5);
    panel.add(new JLabel(resources.getString("Label")), lc);
    GridBagConstraints tc = new GridBagConstraints();
    tc.gridx = 2;
    tc.gridy = 0;
    tc.fill = GridBagConstraints.BOTH;
    tc.weightx = 1;
    tc.gridwidth = 2;
    tc.insets = new Insets(33, 0, 5, 12);
    searchField = new JComboBoxWithHistory();
    searchField.getEditor().addActionListener(new FindNextTrigger());
    panel.add(searchField, tc);
    lc.gridy++;
    tc.gridy++;
    lc.insets.top = tc.insets.top = 0;
    replaceLabel = new JLabel(resources.getString("Replace_Label"));
    panel.add(replaceLabel, lc);
    replaceField = new JComboBoxWithHistory();
    panel.add(replaceField, tc);
    panel.add(BoxUtils.createHorizontalStrut(replaceLabel.getPreferredSize().width), lc);
    panel.add(BoxUtils.createVerticalStrut(replaceField.getPreferredSize().height), tc);
    replaceLabel.setVisible(false);
    replaceField.setVisible(false);
    lc.gridy++;
    panel.add(BoxUtils.createVerticalStrut(10), lc);
    lc.gridy++;
    lc.gridwidth = 1;
    panel.add(new JLabel(resources.getString("Within.Label")), lc);
    GridBagConstraints pc = new GridBagConstraints();
    pc.gridx = 1;
    pc.gridy = lc.gridy;
    pc.gridwidth = 2;
    pc.insets = tc.insets;
    pc.fill = GridBagConstraints.BOTH;
    searchScope = new JComboBox(Scope.values());
    searchScope.setSelectedItem(Scope.All);
    searchScope.addItemListener(new ItemListener() {

        public void itemStateChanged(ItemEvent e) {
            selectedColumns = null;
        }
    });
    panel.add(searchScope, pc);
    lc.gridy++;
    pc.gridy++;
    panel.add(new JLabel(resources.getString("Match.Label")), lc);
    matchType = new JComboBox(Match.values());
    matchType.setSelectedItem(Match.Within);
    panel.add(matchType, pc);
    lc.gridy++;
    pc.gridy++;
    lc.insets.bottom = pc.insets.bottom = 12;
    panel.add(new JLabel(resources.getString("Search_By.Label")), lc);
    rowsOrColumns = new JComboBox(Direction.values());
    rowsOrColumns.setSelectedItem(Direction.Rows);
    panel.add(rowsOrColumns, pc);
    GridBagConstraints wc = new GridBagConstraints();
    wc.gridx = 3;
    wc.gridy = lc.gridy;
    wc.anchor = GridBagConstraints.WEST;
    wc.insets = lc.insets;
    wc.insets.left = 5;
    wrappedIcon = new WrappedIcon();
    panel.add(wrappedIcon, wc);
    GridBagConstraints bc = new GridBagConstraints();
    bc.gridy = lc.gridy + 1;
    bc.anchor = GridBagConstraints.EAST;
    bc.insets = new Insets(10, 5, 0, 0);
    bc.gridwidth = 4;
    Box buttonBox = Box.createHorizontalBox();
    replaceButton = new JButton(replace);
    replaceButton.setVisible(false);
    buttonBox.add(replaceButton);
    buttonBox.add(Box.createHorizontalStrut(30));
    buttonBox.add(prevButton = new JButton(findPrevious));
    buttonBox.add(Box.createHorizontalStrut(5));
    buttonBox.add(new JButton(findNext));
    buttonBox.add(Box.createHorizontalStrut(20));
    buttonBox.add(new JButton(cancel));
    panel.add(buttonBox, bc);
    GridBagConstraints tpc = new GridBagConstraints();
    tpc.gridx = tpc.gridy = 0;
    tpc.gridwidth = 4;
    tpc.gridheight = bc.gridy;
    tpc.fill = GridBagConstraints.BOTH;
    tabs = new JTabbedPane();
    tabs.add(resources.getString("Find"), new JPanel());
    tabs.add(resources.getString("Replace"), new JPanel());
    tabs.addChangeListener(new TabHandler());
    panel.add(tabs, tpc);
    JFrame f = (JFrame) SwingUtilities.getWindowAncestor(tabPanel);
    dialog = new JDialog(f, resources.getString("Title"), false);
    dialog.getContentPane().add(panel);
    dialog.pack();
    dialog.setLocationRelativeTo(f);
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) ItemEvent(java.awt.event.ItemEvent) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) JComboBox(javax.swing.JComboBox) JTabbedPane(javax.swing.JTabbedPane) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) JComboBox(javax.swing.JComboBox) Box(javax.swing.Box) JFrame(javax.swing.JFrame) ItemListener(java.awt.event.ItemListener) JDialog(javax.swing.JDialog)

Aggregations

JTabbedPane (javax.swing.JTabbedPane)89 JPanel (javax.swing.JPanel)42 BorderLayout (java.awt.BorderLayout)28 JButton (javax.swing.JButton)25 JScrollPane (javax.swing.JScrollPane)23 JLabel (javax.swing.JLabel)22 ActionEvent (java.awt.event.ActionEvent)18 Dimension (java.awt.Dimension)17 ActionListener (java.awt.event.ActionListener)15 JCheckBox (javax.swing.JCheckBox)14 ChangeListener (javax.swing.event.ChangeListener)13 BoxLayout (javax.swing.BoxLayout)12 ChangeEvent (javax.swing.event.ChangeEvent)12 JFrame (javax.swing.JFrame)10 GridBagLayout (java.awt.GridBagLayout)9 JMenuItem (javax.swing.JMenuItem)9 JSplitPane (javax.swing.JSplitPane)9 JTable (javax.swing.JTable)9 JTextField (javax.swing.JTextField)9 Component (java.awt.Component)8