private void exportShape(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exportShape
        // TODO add your handling code here:
        JFileChooser filechooser = new JFileChooser();
        ShapeFileFilter shapeFilter = new ShapeFileFilter();
        filechooser.addChoosableFileFilter(shapeFilter);
        int dialogAnswer = filechooser.showSaveDialog(null);
        
        if(dialogAnswer == JFileChooser.APPROVE_OPTION) {
            
            FileWriter outFileWriter = null;
            File saveFile = filechooser.getSelectedFile();
            int overwriteAnswer = JOptionPane.YES_OPTION;
            if(saveFile.exists()) {
                overwriteAnswer = JOptionPane.showConfirmDialog(null, 
                        "Datei existiert bereits.\n Überschreiben??",
                        "Überschreiben?",
                        JOptionPane.YES_NO_OPTION);
                
            }
            if(overwriteAnswer == JOptionPane.YES_OPTION) {
                
                String shape = ShapeAusgabe.getText();
                String filename = saveFile.getAbsolutePath();
                
                if(!filename.toUpperCase().endsWith(".SHAPE")) {
                    filename += ".shape";
                }
                
                try {
                    outFileWriter = new FileWriter(filename);
                    outFileWriter.write(shape);
                    outFileWriter.flush();
                    outFileWriter.close();
                    JOptionPane.showMessageDialog(null, 
                            "Shape Datei erfolgreich exportiert!",
                            "Exportieren erfolgreich",
                            JOptionPane.INFORMATION_MESSAGE);
                } catch (IOException ex) {
                    JOptionPane.showMessageDialog(null,
                            "Fehler beim exportieren von" + filename + ".",
                            "Fehler",
                            JOptionPane.ERROR_MESSAGE);
                } 
            } else {
                exportShape(evt);
            }
            
        }
    }//GEN-LAST:event_exportShape