Search in sources :

Example 86 with JTextField

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

the class NewFileSummary method initComponents.

private void initComponents() {
    fileField = new JTextField();
    fileField.setEditable(false);
    baseCurrencyField = new JTextField();
    baseCurrencyField.setEditable(false);
    currenciesList = new JList<>();
    currenciesList.setBackground((Color) UIManager.getDefaults().get("TextField.inactiveBackground"));
}
Also used : JTextField(javax.swing.JTextField)

Example 87 with JTextField

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

the class MainFrame method buildUI.

private void buildUI() {
    ActionParser actionParser = new ActionParser(this);
    actionParser.preLoadActions("jgnash.ui.actions");
    actionParser.preLoadAction("copy-command", new DefaultEditorKit.CopyAction());
    actionParser.preLoadAction("cut-command", new DefaultEditorKit.CutAction());
    actionParser.preLoadAction("paste-command", new DefaultEditorKit.PasteAction());
    actionParser.preLoadAction("exit-command", new AbstractAction() {

        @Override
        public void actionPerformed(final ActionEvent e) {
            shutDown();
        }
    });
    actionParser.preLoadAction("open-command", new OpenFileAction());
    actionParser.preLoadAction("open-command-tb", new OpenFileAction());
    actionParser.preLoadAction("account-filter-command", new AbstractEnabledAction() {

        @Override
        public void actionPerformed(final ActionEvent e) {
            expandingAccountPanel.showAccountFilterDialog();
        }
    });
    actionParser.preLoadAction("register-filter-command", new AbstractEnabledAction() {

        @Override
        public void actionPerformed(final ActionEvent e) {
            registerTreePanel.showAccountFilterDialog();
        }
    });
    actionParser.preLoadAction("currency-background-update-command", new UpdateExchangeRateAction());
    actionParser.preLoadAction("security-background-update-command", new UpdateSecuritiesAction());
    try (final InputStream stream = MainFrame.class.getResourceAsStream("/jgnash/resource/main-frame-actions.xml")) {
        actionParser.loadFile(stream);
    } catch (final IOException exception) {
        logger.log(Level.SEVERE, exception.getMessage(), exception);
    }
    menuBar = actionParser.createMenuBar("main-menu");
    JToolBar toolBar = actionParser.createToolBar("main-toolbar");
    toolBar.setFloatable(false);
    toolBar.setRollover(true);
    viewMenu = (JMenu) actionParser.getJMenuItem("view-menu-command");
    reportMenu = (JMenu) actionParser.getJMenuItem("report-menu-command");
    windowMenu = (JMenu) actionParser.getJMenuItem("window-menu-command");
    Objects.requireNonNull(windowMenu);
    windowMenu.setEnabled(false);
    editAction = actionParser.getAction("edit-menu-command");
    if (EngineFactory.getEngine(EngineFactory.DEFAULT) == null) {
        setOpenState(false);
    }
    setTitle(Main.VERSION);
    mainView = buildMainView();
    backgroundOperationLabel = new JXBusyLabel(new Dimension(18, 18));
    statusField = new JTextField();
    statusField.setEditable(false);
    statusField.setFont(statusField.getFont().deriveFont(statusField.getFont().getSize2D() - 1f));
    infoColor = statusField.getForeground();
    JXStatusBar statusBar = new JXStatusBar();
    statusBar.setResizeHandleEnabled(true);
    statusBar.add(statusField, new JXStatusBar.Constraint(JXStatusBar.Constraint.ResizeBehavior.FILL));
    if (ThemeManager.isLookAndFeelSubstance()) {
        statusBar.add(new SubstanceFontSlider());
    }
    statusBar.add(backgroundOperationLabel);
    statusBar.add(new MemoryMonitor(), new JXStatusBar.Constraint(120));
    JPanel contentPanel = new JPanel(new BorderLayout());
    contentPanel.add(toolBar, BorderLayout.NORTH);
    contentPanel.add(mainView, BorderLayout.CENTER);
    contentPanel.add(statusBar, BorderLayout.SOUTH);
    JPanel rootPanel = new JPanel(new BorderLayout());
    rootPanel.add(menuBar, BorderLayout.NORTH);
    rootPanel.add(contentPanel, BorderLayout.CENTER);
    waitPanel = new WaitMessagePanel();
    busyLayerUI = new BusyLayerUI();
    JLayer<JPanel> rootLayer = new JLayer<>(rootPanel, busyLayerUI);
    getContentPane().add(rootLayer, BorderLayout.CENTER);
    setGlassPane(waitPanel);
}
Also used : JPanel(javax.swing.JPanel) SubstanceFontSlider(jgnash.ui.components.SubstanceFontSlider) JLayer(javax.swing.JLayer) ActionEvent(java.awt.event.ActionEvent) JTextField(javax.swing.JTextField) ActionParser(jgnash.ui.util.builder.ActionParser) BorderLayout(java.awt.BorderLayout) DefaultEditorKit(javax.swing.text.DefaultEditorKit) AbstractAction(javax.swing.AbstractAction) JXBusyLabel(org.jdesktop.swingx.JXBusyLabel) WaitMessagePanel(jgnash.ui.components.WaitMessagePanel) AbstractEnabledAction(jgnash.ui.actions.AbstractEnabledAction) InputStream(java.io.InputStream) IOException(java.io.IOException) JToolBar(javax.swing.JToolBar) Dimension(java.awt.Dimension) MemoryMonitor(jgnash.ui.components.MemoryMonitor) JXStatusBar(org.jdesktop.swingx.JXStatusBar)

Example 88 with JTextField

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

the class BudgetPropertiesDialog method initComponents.

private void initComponents() {
    budgetPeriodCombo = new JComboBox<>();
    budgetPeriodCombo.setModel(new DefaultComboBoxModel<>(Period.values()));
    descriptionField = new JTextField();
    assetGroupCheckBox = new JCheckBox(rb.getString("Button.AssetAccounts"));
    incomeGroupCheckBox = new JCheckBox(rb.getString("Button.IncomeAccounts"));
    expenseGroupCheckBox = new JCheckBox(rb.getString("Button.ExpenseAccounts"));
    liabilityGroupCheckBox = new JCheckBox(rb.getString("Button.LiabilityAccounts"));
    assetGroupCheckBox.setSelected(budget.areAssetAccountsIncluded());
    incomeGroupCheckBox.setSelected(budget.areIncomeAccountsIncluded());
    expenseGroupCheckBox.setSelected(budget.areExpenseAccountsIncluded());
    liabilityGroupCheckBox.setSelected(budget.areLiabilityAccountsIncluded());
    okButton = new JButton(rb.getString("Button.Ok"));
    okButton.addActionListener(this);
    cancelButton = new JButton(rb.getString("Button.Cancel"));
    cancelButton.addActionListener(this);
}
Also used : JCheckBox(javax.swing.JCheckBox) JButton(javax.swing.JButton) JTextField(javax.swing.JTextField)

Example 89 with JTextField

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

the class RenameBudgetDialog method initComponents.

private void initComponents() {
    okButton = new JButton(rb.getString("Button.Ok"));
    cancelButton = new JButton(rb.getString("Button.Cancel"));
    budgetNameField = new JTextField(budget.getName());
    okButton.addActionListener(this);
    cancelButton.addActionListener(this);
}
Also used : JButton(javax.swing.JButton) JTextField(javax.swing.JTextField)

Example 90 with JTextField

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

the class CurrenciesPanel 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"));
    customButton = new JButton(rb.getString("Button.Add"));
    customField = new JTextField();
    // generate the Jlists
    buildLists();
}
Also used : JButton(javax.swing.JButton) JTextField(javax.swing.JTextField)

Aggregations

JTextField (javax.swing.JTextField)450 JLabel (javax.swing.JLabel)270 JPanel (javax.swing.JPanel)236 JButton (javax.swing.JButton)135 BorderLayout (java.awt.BorderLayout)115 GridBagLayout (java.awt.GridBagLayout)94 Insets (java.awt.Insets)94 GridBagConstraints (java.awt.GridBagConstraints)93 Dimension (java.awt.Dimension)91 JCheckBox (javax.swing.JCheckBox)89 ActionEvent (java.awt.event.ActionEvent)84 ActionListener (java.awt.event.ActionListener)75 JScrollPane (javax.swing.JScrollPane)64 BoxLayout (javax.swing.BoxLayout)50 JTextArea (javax.swing.JTextArea)40 FlowLayout (java.awt.FlowLayout)39 JComboBox (javax.swing.JComboBox)39 JRadioButton (javax.swing.JRadioButton)37 ButtonGroup (javax.swing.ButtonGroup)35 JTable (javax.swing.JTable)34