22 package org.matsim.run.gui;
26 import javax.swing.JFileChooser;
27 import javax.swing.JOptionPane;
32 class SaveFileSaver
extends JFileChooser {
33 private static final long serialVersionUID = 1L;
36 public void approveSelection() {
37 File f = getSelectedFile();
38 if (f.exists() && getDialogType() == SAVE_DIALOG) {
39 String msg = String.format(
40 "<html>ā%sā already exists.<br>Do you want to replace it?",
42 int option = JOptionPane.showOptionDialog(
this, msg,
"Save As", JOptionPane.YES_NO_OPTION,
43 JOptionPane.WARNING_MESSAGE, null,
new String[] {
"Replace",
"Cancel"},
"Cancel");
48 super.approveSelection();