private static final long serialVersionUID = 1L;
public void actionPerformed(ActionEvent e) {
PlotImagesFileFilter PNGfilter = new PlotImagesFileFilter(".png", "Portable Network Graphics images");
PlotImagesFileFilter EPSfilter = new PlotImagesFileFilter(".eps", "Encapsulated Post Script images");
PlotImagesFileChooser fileChooser = new PlotImagesFileChooser(PNGfilter);
fileChooser.setFileFilter(PNGfilter);
fileChooser.addChoosableFileFilter(EPSfilter);
int r = fileChooser.showSaveDialog(EnlargeQQPlotVarVar.this);
if (r == JFileChooser.APPROVE_OPTION) {
File file = fileChooser.getSelectedFile();
if (fileChooser.getFileFilter().equals(EPSfilter)) {
EnlargeQQPlotVarVar plot = EnlargeQQPlotVarVar.this;
try {
FileOutputStream fileStream = new FileOutputStream(file);
plot.export(fileStream);
fileStream.close();