private void initComponents()
    {
        setLayout(new BorderLayout());
        final List<Image> icons = new ArrayList<Image>();
        icons.add(new ImageIcon(TallyDialog.class.getResource("/icons/calc16.png")).getImage());
        setIconImages(icons);
        setModalityType(ModalityType.MODELESS);
        setPreferredSize(new Dimension(150, 274));

        setTitle("Quick Tally");
        setDefaultCloseOperation(DISPOSE_ON_CLOSE);
        
        totalLabel = new JLabel("Total: $0.00");
        //totalLabel.setHorizontalAlignment(JLabel.CENTER);
        add(totalLabel, BorderLayout.SOUTH);
        
        final JPanel middle = new JPanel(new BorderLayout());
        
        tallyTable = new TallyTable();
        tallyTable.getModel().addTableModelListener(new TableModelListener() {
            @Override
            public void tableChanged(TableModelEvent event) {
                updateTotal();
            }
        });
        tallyTable.setEnabled(false);
        
        final JScrollPane scrollPane = new JScrollPane(tallyTable);
        scrollPane.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
        middle.add(scrollPane, BorderLayout.CENTER);
        
        valueField = new CurrencyFormattedTextField(true); 
        valueField.addKeyListener(new KeyAdapter() {
            @Override
            public void keyReleased(KeyEvent event) {
                if (KeyEvent.VK_ENTER == event.getKeyCode() || 
                    KeyEvent.VK_ADD == event.getKeyCode()) {
                    final String value = valueField.getText();
                    try {
                        final double doubleValue = NumberFormat.getNumberInstance().parse(value).doubleValue();
                        if (doubleValue != 0.0) {
                            tallyTable.addValue(new BigDecimal(doubleValue));
                        }
                    } catch (ParseException e) {
                    }
                    valueField.setText("");
                } else if (KeyEvent.VK_SUBTRACT == event.getKeyCode() ||
                           KeyEvent.VK_MINUS == event.getKeyCode()) {
                    final String value = valueField.getText();
                    try {
                        final double doubleValue = NumberFormat.getNumberInstance().parse(value).doubleValue();
                        if (doubleValue != 0.0) {
                            tallyTable.addValue(new BigDecimal(doubleValue));
                            valueField.setText("-");
                        }
                    } catch (ParseException e) {
                    }
                } else if (KeyEvent.VK_ESCAPE == event.getKeyCode()) {
                    clearData();
                }
            }

        });
        valueField.requestFocusInWindow();
        valueField.setText("0.00");
        valueField.setSelectionStart(0);
        valueField.setSelectionEnd(valueField.getText().length()-1);
        
        middle.add(valueField, BorderLayout.SOUTH);
        
        add(middle, BorderLayout.CENTER);
        invalidate();
        pack();
    }