JFrame jf = new JFrame("Graph Visualizer"); GraphVisualizer g = new GraphVisualizer();  try{ if(args[0].endsWith(".xml")) {         g.readBIF( new FileInputStream(args[0]) ); } else {  g.readDOT(new FileReader(args[0])); } } catch(IOException ex) { ex.printStackTrace(); } catch(BIFFormatException bf) { bf.printStackTrace(); System.exit(-1); }  jf.getContentPane().add(g);  jf.setDefaultCloseOperation( jf.EXIT_ON_CLOSE ); jf.setSize(800,600);  jf.setVisible(true);
JFrame jf = new JFrame("Graph Visualizer"); GraphVisualizer g = new GraphVisualizer();  try{ if(args[0].endsWith(".xml")) {         g.readBIF( new FileInputStream(args[0]) ); } else {  g.readDOT(new FileReader(args[0])); }
    public static void main(String [] args) {	JFrame jf = new JFrame("Graph Visualizer");	GraphVisualizer g = new GraphVisualizer();	try{	    if(args[0].endsWith(".xml")) {		//StringBuffer sb = new StringBuffer();		//FileReader infile = new FileReader(args[0]);		//int i;		//while( (i=infile.read())!=-1) {		//    sb.append((char)i);		//}		//System.out.println(sb.toString());		//g.readBIF(sb.toString() );		g.readBIF( new FileInputStream(args[0]) );	    }	    else {		//BufferedReader infile=new BufferedReader();		g.readDOT(new FileReader(args[0])); //infile);	    }	}	catch(IOException ex) { ex.printStackTrace(); }	catch(BIFFormatException bf) { bf.printStackTrace(); System.exit(-1); }	jf.getContentPane().add(g);	//RepaintManager.currentManager(jf.getRootPane()).setDoubleBufferingEnabled(false);	jf.setDefaultCloseOperation( jf.EXIT_ON_CLOSE );	jf.setSize(800,600);	//jf.pack();	jf.setVisible(true);    }