code: public static void renderDOTExternal(Reader r, String format) {
          try {
              File image = File.createTempFile("dot", format);
              runDOT(r, format, image);
              Desktop.getDesktop().open(image);
          } catch (IOException e) {
              JOptionPane.showMessageDialog(null,
                                            "Error rendering DOT: " + e.getMessage(),
                                            "Error",
                                            JOptionPane.ERROR_MESSAGE);
          }
      }
docs: Renders a GraphVIZ description, using an external program for displaying. The program is determined by the
  system's file type associations, using the {@link Desktop#open(File)} method.
  
  @param r
  the reader from which the GraphVIZ description is read.
  @param format
  the output format, as understood by the dot utility, e.g., png, ps, ...