// CS101 Lab 6 // Lab6.java // Ron Cytron // This creates a Startup object and starts it running. // You should not need to modify this file. import java.applet.Applet; import java.awt.Image; import java.net.URL; public class Lab6 extends Applet { public static boolean isApplet = false; public static Applet thisApplet; public Lab6() { thisApplet = this; } public void init() { String args[] = new String[1]; args[0] = ""; isApplet = true; main(args); } public static Image loadImage(String s) { Image ans = null; try { ans = thisApplet.getImage( new URL( "http://www.cs.wustl.edu/~cytron/cs101/"+s) ); } catch(Exception e) { System.err.println(e); System.exit(-1); } return(ans); // return (thisApplet.getImage(thisApplet.getDocumentBase(), s)); } public static void main(String args[]) { System.out.println( "Starting Lab6..."); new Thread(new Startup()).start(); } }