public SplitsDialog(JDialog parent, List<TransactionSplit> splits, AccountRecord account) {
        super(parent, "Edit Splits", true);
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        this.splits = splits;

        //
        // Create the splits table
        //
        tableModel = new SplitModel();
        table = new SizedTable(tableModel, columnTypes);
        table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        table.setCellSelectionEnabled(true);
        table.setSurrendersFocusOnKeystroke(true);
        Dimension tableSize = table.getPreferredSize();
        table.setPreferredScrollableViewportSize(new Dimension(tableSize.width, 10*table.getRowHeight()));

        //
        // Set up the table cell editors
        //
        categoryAccountModel = new TransferComboBoxModel(account, null, null);
        TableColumnModel columnModel = table.getColumnModel();
        for (int i=0; i<columnNames.length; i++) {
            Object value = null;
            TableColumn column = columnModel.getColumn(i);

            switch (i) {
                case 0:                         // Description
                    break;

                case 1:                         // Category/Account
                    column.setCellEditor(new DefaultCellEditor(new JComboBox(categoryAccountModel)));
                    break;

                case 2:                         // Payment
                case 3:                         // Deposit
                    column.setCellEditor(new AmountEditor(2, true));
                    break;

                case 4:                         // Balance (not editable)
                    DefaultTableCellRenderer renderer = (DefaultTableCellRenderer)column.getCellRenderer();
                    renderer.setBackground(new Color(240, 240, 240));
                    break;

                default:
                    throw new IndexOutOfBoundsException("Table column "+i+" is not valid");
            }
        }
            
        //
        // Pressing ENTER while not editing a cell will activate the
        // default button.  Pressing ENTER while editing a cell will
        // stop editing the cell.
        //
        table.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "check edit");
        table.getActionMap().put("check edit", new AbstractAction() {
            public void actionPerformed(ActionEvent event) {
                JTable table = (JTable)event.getSource();
                JButton defaultButton = table.getRootPane().getDefaultButton();
                if (defaultButton != null)
                    defaultButton.doClick();
            }
        });

        //
        // Create the table scroll pane
        //
        JScrollPane scrollPane = new JScrollPane(table);

        //
        // Create the buttons (New Split, Delete Split, Done)
        //
        JPanel buttonPane = new JPanel();
        buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.X_AXIS));

        JButton button = new JButton("New Split");
        button.setActionCommand("add");
        button.addActionListener(this);
        buttonPane.add(button);
        getRootPane().setDefaultButton(button);
        
        buttonPane.add(Box.createHorizontalStrut(10));

        button = new JButton("Delete Split");
        button.setActionCommand("delete");
        button.addActionListener(this);
        buttonPane.add(button);
        
        buttonPane.add(Box.createHorizontalStrut(10));

        button = new JButton("Done");
        button.setActionCommand("done");
        button.addActionListener(this);
        buttonPane.add(button);

        //
        // Set up the content pane
        //
        JPanel contentPane = new JPanel();
        contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
        contentPane.setOpaque(true);
        contentPane.setBorder(BorderFactory.createEmptyBorder(30, 30, 30, 30));
        contentPane.add(scrollPane);
        contentPane.add(Box.createVerticalStrut(15));
        contentPane.add(buttonPane);
        setContentPane(contentPane);
    }