try { graph.exportImageFile(new File("graph.png"), 1.0); } catch (IOException ioe) { System.err.println("Failed to export the image file"); }