JOptionPane.QUESTION_MESSAGE);
if (response == JOptionPane.CLOSED_OPTION || response == JOptionPane.NO_OPTION) {
return ; // Do not save, user does not want to overwrite
}
}
SaveGraphicsService save = new SaveGraphicsService();
String ext = filename.substring(filename.length() - 4);
String name = filename.substring(0, filename.length() - 4);
if (ext.equals(SaveGraphicsService.PNG_EXTENSION)) {
save.saveJComponent(name, SaveGraphicsService.PNG, comp);
} else if (ext.equals(SaveGraphicsService.TIFF_EXTENSION)) {
save.saveJComponent(name, SaveGraphicsService.TIFF, comp);
} else {
save.saveJComponent(filename, SaveGraphicsService.PNG, comp);
}
}
}