protected void exportClusters() {
        String fname = fc.getSelectedFile().getAbsolutePath();
        File newFile = new File(fname+".cluster");
        fc.setSelectedFile(newFile);
        int retval = fc.showSaveDialog(this);
            
            if(retval == JFileChooser.APPROVE_OPTION) {
            try {
                File f = fc.getSelectedFile();
                BufferedWriter out = new BufferedWriter(new FileWriter(f));
                int i = 0;
                for (HashSet<Point> c : clusters) {
                    out.write("#"+i+"\n");
                    for (Point p : c) {
                        out.write(p+"\n");
                    }
                    i++;
                }
                out.write("#noise\n");
                for(Point p: noise) {
                    out.write(p+"\n");
                }
                log.append("Exported to file "+f.getName()+"\n");
                out.close();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
        } 
        
    }