private void yesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_yesActionPerformed
        File csvBatteries = new File("batteries.csv");
        File csvMatches = new File("matches.csv");
        try {
            BufferedWriter writer = new BufferedWriter(new FileWriter(csvBatteries));
            csvBatteries.delete();
            csvBatteries.createNewFile();

            for (MatchBatterySetup row : rows) {
                writer.write(row.getBatteryText() + ", true");
                writer.newLine();
            }
            writer.flush();
            writer.close();
            
            csvMatches.delete();
            csvMatches.createNewFile();
            writer = new BufferedWriter(new FileWriter(csvMatches));

            int index = 0;
            for (Match match : schedule) {
                if (match.searchFor(2771)) {
                    match.setBattery(new Battery(rows.get(index).getBatteryText()));
                    index++;
                }
                writer.write(match.getMatchNumber() + ","
                        + match.getRedStation1() + ","
                        + match.getRedStation2() + ","
                        + match.getRedStation3() + ","
                        + match.getBlueStation1() + ","
                        + match.getBlueStation2() + ","
                        + match.getBlueStation3() + ","
                        + match.getBattery().getBatteryLetter() + ","
                        + match.getMatchTime());
                writer.newLine();
            }
            writer.flush();
            writer.close();
            
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(this, "The event schedule was downloaded from the internet,\n"
                    + "but an error occurred when saving it as CSV data.\n"
                    + "Verify that you do not have batteries.csv or matches.csv\n"
                    + "open in another program.  The information downloaded from\n"
                    + "the internet has been saved in schedule.csv.", "File write error", JOptionPane.ERROR_MESSAGE);
        }
        StartupSequence.loadCSVData();
        main.done();
    }//GEN-LAST:event_yesActionPerformed