// Note: source for ExampleFileFilter can be found in FileChooserDemo,
// under the demo/jfc directory in the JDK.
int returnVal = chooser.showOpenDialog(Main.mainFrame);
if(returnVal == JFileChooser.APPROVE_OPTION) {
try {
GnuCashParser parser = new GnuCashParser(this);
File file = chooser.getSelectedFile();
parser.parse(new InputStreamReader(new FileInputStream(file)));
}
catch (Exception ex) {
throw new RuntimeException(ex);
}
}