private void save() {
        if (JFileChooser.APPROVE_OPTION != fileChooser.showSaveDialog(this))
            return;
        File file = fileChooser.getSelectedFile();
        if (!file.getPath().endsWith(".play"))
        	file = new File(file.getPath() + ".play");
        FileWriter out = null;
        try {
            int i, j;
        	out = new FileWriter(file);
            out.write(SaveDataFileHeader + "\n");
            for (i = 0; i < playTable.getRowCount(); ++i) {
                for (j = 0; j < playTable.getColumnCount(); ++j)
                    out.write(playTable.getValueAt(i, j).toString() + ",");
                out.write("\n");
            }
        }
        catch (Exception e) {
            e.printStackTrace();
            logger.error(e);
            JOptionPane.showMessageDialog(null, "Failed to save table:\n\n" + e, "Error", JOptionPane.ERROR_MESSAGE);
        }
        finally {
        	if (out != null) {
                try {
                	out.close();
                }
                catch (IOException e) {
                    logger.error(e);
                }
        	}
        }
    }