use of jgnash.ui.components.IndeterminateCheckBox in project jgnash by ccavanaugh.
the class AbstractTransactionEntryPanel method init.
private void init() {
amountField = new JFloatField(account.getCurrencyNode());
accountPanel = new AccountExchangePanel(account.getCurrencyNode(), account, amountField);
enterButton = new JButton(rb.getString("Button.Enter"));
cancelButton = new JButton(rb.getString("Button.Clear"));
memoField = AutoCompleteFactory.getMemoField();
reconciledButton = new IndeterminateCheckBox(rb.getString("Button.Reconciled"));
reconciledButton.setHorizontalTextPosition(SwingConstants.LEADING);
reconciledButton.setMargin(new Insets(0, 0, 0, 0));
/* Connect the buttons to the form */
cancelButton.addActionListener(this);
enterButton.addActionListener(this);
/* Allows the user to submit the form from the keyboard when the enter button is selected */
KeyAdapter enterKeyListener = new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
enterAction();
}
}
};
enterButton.addKeyListener(enterKeyListener);
amountField.addKeyListener(enterKeyListener);
// focus will return to the first field
setFocusCycleRoot(true);
}
Aggregations