int result = filterFileChooser.showSaveDialog(this);
if (result == JFileChooser.APPROVE_OPTION) {
FileOutputStream out;
try {
out = new FileOutputStream(filterFileChooser.getSelectedFile());
FilterSpecDao writer = new JaxbFilterSpecDao();
writer.saveFilter(filterContext, out);
out.close();
} catch (FileNotFoundException e) {
JOptionPane.showMessageDialog(this, "There was a problem saving the filter.", "Filter warning", JOptionPane.ERROR_MESSAGE);
} catch (JAXBException e) {
JOptionPane.showMessageDialog(this, "There was a problem saving the filter.", "Filter warning", JOptionPane.ERROR_MESSAGE);