import java.awt.*; import java.applet.*; import java.net.*; public class ImageDrawer extends Applet { Image image = null; public void init() { setSize(419,545); URL origin = getCodeBase(); URL map = null; try { map = new URL ("http://" + origin.getHost() + "/" + origin.getPath() + "map.jpg"); map = new URL ("file://" + origin.getPath() + "map.jpg"); System.out.println(map); } catch (MalformedURLException mue) { mue.printStackTrace(); } image = getImage(map); repaint(); } public void paint (Graphics g) { if (image != null) { g.drawImage(image,0,0,this); } } }