JMenuItem open = new JMenuItem(survey.getStrings().getOpenString());
open.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, ActionEvent.CTRL_MASK));
open.setMnemonic(KeyEvent.VK_O);
open.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
Chooser chooser = new Chooser();
chooser.addChoosableFileFilter(new FileNameExtensionFilter("XML Files", "xml"));
if (chooser.showOpenDialog(frame) == JFileChooser.APPROVE_OPTION) {
try {
survey.loadXMLAnswers(chooser.getSelectedFile().getAbsolutePath());
} catch (IOException e) {
//TODO: i18n this error message
JOptionPane.showMessageDialog(frame, e.getMessage(), survey.getTitle(), JOptionPane.ERROR_MESSAGE);
throw new RuntimeException(e);
} catch (SAXException e) {