Search in sources :

Example 1 with AccountListComboBox

use of jgnash.ui.components.AccountListComboBox in project jgnash by ccavanaugh.

the class RecurringEntryDialog method createTransactionPanel.

private JPanel createTransactionPanel() {
    FormLayout layout = new FormLayout("left:p, 4dlu, p:g, 4dlu, p", "f:p, 3dlu, f:p, 3dlu, f:p, 3dlu, f:40dlu:g");
    layout.setRowGroups(new int[][] { { 1, 3, 5 } });
    CellConstraints cc = new CellConstraints();
    JPanel p = new JPanel(layout);
    descriptionField = new JTextFieldEx();
    accountCombo = new AccountListComboBox();
    notesArea = new JTextArea(5, 20);
    notesArea.setLineWrap(true);
    notesArea.setAutoscrolls(true);
    JScrollPane pane = new JScrollPane(notesArea);
    pane.setAutoscrolls(true);
    transactionField = new JTextFieldEx();
    transactionField.setEditable(false);
    editButton = new JButton(rb.getString("Button.Edit"));
    deleteButton = new JButton(rb.getString("Button.Delete"));
    p.add(new JLabel(rb.getString("Label.Account")), cc.xy(1, 1));
    p.add(accountCombo, cc.xywh(3, 1, 3, 1));
    p.add(new JLabel(rb.getString("Label.Description")), cc.xy(1, 3));
    p.add(descriptionField, cc.xywh(3, 3, 3, 1));
    p.add(new JLabel(rb.getString("Label.Transaction")), cc.xy(1, 5));
    p.add(transactionField, cc.xy(3, 5));
    p.add(new ButtonBarBuilder().addButton(editButton, deleteButton).build(), cc.xy(5, 5));
    p.add(new JLabel(rb.getString("Label.Notes")), cc.xy(1, 7));
    p.add(pane, cc.xywh(3, 7, 3, 1));
    return p;
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) JTextArea(javax.swing.JTextArea) ButtonBarBuilder(com.jgoodies.forms.builder.ButtonBarBuilder) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) JTextFieldEx(jgnash.ui.components.JTextFieldEx) AccountListComboBox(jgnash.ui.components.AccountListComboBox) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Example 2 with AccountListComboBox

use of jgnash.ui.components.AccountListComboBox in project jgnash by ccavanaugh.

the class ImportOne method initComponents.

private void initComponents() {
    accountCombo = new AccountListComboBox();
    helpPane = new JTextPane();
    helpPane.setEditable(false);
    helpPane.setEditorKit(new StyledEditorKit());
    helpPane.setBackground(getBackground());
    helpPane.setText(TextResource.getString("ImportOne.txt"));
}
Also used : StyledEditorKit(javax.swing.text.StyledEditorKit) JTextPane(javax.swing.JTextPane) AccountListComboBox(jgnash.ui.components.AccountListComboBox)

Example 3 with AccountListComboBox

use of jgnash.ui.components.AccountListComboBox in project jgnash by ccavanaugh.

the class PartialOne method initComponents.

private void initComponents() {
    accountCombo = new AccountListComboBox();
    helpPane = new JTextPane();
    helpPane.setEditable(false);
    helpPane.setEditorKit(new StyledEditorKit());
    helpPane.setBackground(getBackground());
    helpPane.setText(TextResource.getString("QifOne.txt"));
    /* Create the combo for date format selection */
    dateFormatCombo = new JComboBox<>(DateFormat.values());
    dateFormatCombo.addActionListener(this);
    dateFormatCombo.setSelectedIndex(pref.getInt(DATE_FORMAT, 0));
    accountCombo.addActionListener(this);
    /* Try a set the comboBox to the last selected account */
    String lastAccount = pref.get(LAST_ACCOUNT, "");
    final Engine engine = EngineFactory.getEngine(EngineFactory.DEFAULT);
    Objects.requireNonNull(engine);
    final Account last = engine.getAccountByUuid(lastAccount);
    if (last != null) {
        setAccount(last);
    }
}
Also used : StyledEditorKit(javax.swing.text.StyledEditorKit) JTextPane(javax.swing.JTextPane) QifAccount(jgnash.convert.imports.qif.QifAccount) Account(jgnash.engine.Account) AccountListComboBox(jgnash.ui.components.AccountListComboBox) Engine(jgnash.engine.Engine)

Aggregations

AccountListComboBox (jgnash.ui.components.AccountListComboBox)3 JTextPane (javax.swing.JTextPane)2 StyledEditorKit (javax.swing.text.StyledEditorKit)2 ButtonBarBuilder (com.jgoodies.forms.builder.ButtonBarBuilder)1 CellConstraints (com.jgoodies.forms.layout.CellConstraints)1 FormLayout (com.jgoodies.forms.layout.FormLayout)1 JButton (javax.swing.JButton)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1 JScrollPane (javax.swing.JScrollPane)1 JTextArea (javax.swing.JTextArea)1 QifAccount (jgnash.convert.imports.qif.QifAccount)1 Account (jgnash.engine.Account)1 Engine (jgnash.engine.Engine)1 JTextFieldEx (jgnash.ui.components.JTextFieldEx)1