public void actionPerformed(ActionEvent ae) {

        //
        // Process the action command
        //
        // "create report" - Create the report
        // "done" - Done
        //
        try {
            switch (ae.getActionCommand()) {
                case "create report":
                    Date startDate, endDate;
                    if (!startField.isEditValid() || !endField.isEditValid()) {
                        JOptionPane.showMessageDialog(this, "You must specify start and end dates",
                                                      "Error", JOptionPane.ERROR_MESSAGE);
                    } else {
                        startDate = (Date)startField.getValue();
                        endDate = (Date)endField.getValue();
                        if (endDate.compareTo(startDate) < 0) {
                            JOptionPane.showMessageDialog(this, "The end date is before the start date",
                                                          "Error", JOptionPane.ERROR_MESSAGE);
                        } else {
                            generateReport(startDate, endDate);
                        }
                    }
                    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);
        }
    }