public void actionPerformed(ActionEvent ae) {

        //
        // Process the action command
        //
        // "create report" - Create the report
        // "done" - All done
        //
        try {
            switch (ae.getActionCommand()) {
                case "create report":
                    AccountRecord account;
                    SecurityRecord security;
                    int index = accountField.getSelectedIndex();
                    if (index < 0) {
                        JOptionPane.showMessageDialog(this, "You must specify an investment account",
                                                      "Error", JOptionPane.ERROR_MESSAGE);
                    } else {
                        account = (AccountRecord)accountModel.getDBElementAt(index);
                        index = securityField.getSelectedIndex();
                        if (index >= 0)
                            security = (SecurityRecord)securityModel.getDBElementAt(index);
                        else
                            security = null;

                        securityField.setSelectedIndex(-1);
                        generateReport(account, security);
                    }
                    break;
                    
                case "done":
                    setVisible(false);
                    dispose();
                    break;
            }
        } catch (ReportException exc) {
            Main.logException("Exception while generating report", exc);
        } catch (Exception exc) {
            Main.logException("Exception while processing action event", exc);
        }
    }