Search in sources :

Example 6 with StyledEditorKit

use of javax.swing.text.StyledEditorKit in project jgnash by ccavanaugh.

the class BudgetWizardDialog method initComponents.

private void initComponents() {
    okButton = new JButton(rb.getString("Button.Ok"));
    cancelButton = new JButton(rb.getString("Button.Cancel"));
    budgetPeriodCombo = new JComboBox<>();
    budgetPeriodCombo.setModel(new DefaultComboBoxModel<>(Period.values()));
    budgetPeriodCombo.setSelectedItem(Period.MONTHLY);
    budgetNameField = new JTextField();
    DefaultUnitConverter unitConverter = DefaultUnitConverter.getInstance();
    helpPane = new JEditorPane();
    helpPane.setEditable(false);
    helpPane.setEditorKit(new StyledEditorKit());
    helpPane.setBackground(getBackground());
    helpPane.setText(TextResource.getString("NewBudgetOne.txt"));
    helpPane.setPreferredSize(new Dimension(unitConverter.dialogUnitXAsPixel(DLU_X, helpPane), unitConverter.dialogUnitYAsPixel(DLU_Y, helpPane)));
    roundButton = new JCheckBox(rb.getString("Button.RoundToWhole"));
    okButton.addActionListener(this);
    cancelButton.addActionListener(this);
}
Also used : StyledEditorKit(javax.swing.text.StyledEditorKit) JCheckBox(javax.swing.JCheckBox) JButton(javax.swing.JButton) JEditorPane(javax.swing.JEditorPane) DefaultUnitConverter(com.jgoodies.forms.util.DefaultUnitConverter) Dimension(java.awt.Dimension) JTextField(javax.swing.JTextField)

Example 7 with StyledEditorKit

use of javax.swing.text.StyledEditorKit in project jgnash by ccavanaugh.

the class ImportTwo method initComponents.

private void initComponents() {
    table = new ImportTable();
    deleteButton = new JButton(rb.getString("Button.Delete"));
    helpPane = new JTextPane();
    helpPane.setEditable(false);
    helpPane.setEditorKit(new StyledEditorKit());
    helpPane.setBackground(getBackground());
    helpPane.setText(TextResource.getString("ImportTwo.txt"));
    addComponentListener(new ComponentAdapter() {

        @Override
        public void componentShown(ComponentEvent evt) {
            refreshInfo();
        }
    });
    deleteButton.addActionListener(this);
    JTableUtils.packGenericTable(table);
}
Also used : StyledEditorKit(javax.swing.text.StyledEditorKit) JTextPane(javax.swing.JTextPane) JButton(javax.swing.JButton) ComponentEvent(java.awt.event.ComponentEvent) ComponentAdapter(java.awt.event.ComponentAdapter)

Example 8 with StyledEditorKit

use of javax.swing.text.StyledEditorKit in project jgnash by ccavanaugh.

the class NewFileThree method initComponents.

private void initComponents() {
    addButton = new JButton(rb.getString("Button.Add"));
    addButton.setIcon(IconUtils.getIcon("/jgnash/resource/list-add.png"));
    addButton.setHorizontalTextPosition(SwingConstants.LEADING);
    removeButton = new JButton(rb.getString("Button.Remove"));
    removeButton.setIcon(IconUtils.getIcon("/jgnash/resource/list-remove.png"));
    aJList = new JList<>();
    cJList = new JList<>();
    helpPane = new JEditorPane();
    helpPane.setEditable(false);
    helpPane.setEditorKit(new StyledEditorKit());
    helpPane.setBackground(getBackground());
    helpPane.setText(TextResource.getString("NewFileThree.txt"));
    addButton.addActionListener(this);
    removeButton.addActionListener(this);
}
Also used : StyledEditorKit(javax.swing.text.StyledEditorKit) JButton(javax.swing.JButton) JEditorPane(javax.swing.JEditorPane)

Example 9 with StyledEditorKit

use of javax.swing.text.StyledEditorKit 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 10 with StyledEditorKit

use of javax.swing.text.StyledEditorKit 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

StyledEditorKit (javax.swing.text.StyledEditorKit)10 JButton (javax.swing.JButton)5 JEditorPane (javax.swing.JEditorPane)5 JTextPane (javax.swing.JTextPane)4 ComponentAdapter (java.awt.event.ComponentAdapter)2 ComponentEvent (java.awt.event.ComponentEvent)2 AccountListComboBox (jgnash.ui.components.AccountListComboBox)2 DefaultUnitConverter (com.jgoodies.forms.util.DefaultUnitConverter)1 Dimension (java.awt.Dimension)1 MouseEvent (java.awt.event.MouseEvent)1 IOException (java.io.IOException)1 URL (java.net.URL)1 JCheckBox (javax.swing.JCheckBox)1 JLabel (javax.swing.JLabel)1 JTextField (javax.swing.JTextField)1 JTree (javax.swing.JTree)1 QifAccount (jgnash.convert.imports.qif.QifAccount)1 Account (jgnash.engine.Account)1 Engine (jgnash.engine.Engine)1 DataStoreTypeCombo (jgnash.ui.components.DataStoreTypeCombo)1