public static void showInstance(final File inFile, final String type, final AbstractJChemPaintPanel jcpPanel, final boolean debug) { try { final IChemModel chemModel = JChemPaint.readFromFile(inFile, type, jcpPanel); final String name = inFile.getName(); final JChemPaintPanel p = JChemPaint.showInstance(chemModel, name, debug); p.setCurrentWorkDirectory(inFile.getParentFile()); p.setLastOpenedFile(inFile); p.setIsAlreadyAFile(inFile); } catch (final CDKException ex) { JOptionPane.showMessageDialog(jcpPanel, ex.getMessage()); return; } catch (final FileNotFoundException e) { JOptionPane.showMessageDialog(jcpPanel, GT._("File does not exist") + ": " + inFile.getPath()); return; } }