JFileChooser fileChooser = new JFileChooser(); if (fileChooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) if (JOptionPane.showConfirmDialog(this, fileChooser.getSelectedFile().getName() + " ist bereits vorhanden." + System.getProperty("line.separator") + "Möchten Sie sie ersetzen?", "Speichern bestätigen", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) //speichern |