a1.html
<applet code="zzz" width=350 height=300></applet>
zzz.java programs
The import statements for all the programs
Program 1import java.applet.*; import java.awt.*; import java.awt.image.*;
Program 2public class zzz extends Applet { Image o; public void init() { o=getImage(getDocumentBase(),"joe.surf.yellow.small.gif"); } public void paint(Graphics g) { g.drawImage(o,0,0,this); } }
Program 3public class zzz extends Applet { Image o; public void init() { o=getImage(getDocumentBase(),"joe.surf.yellow.small.gif"); } public void paint(Graphics g) { g.drawImage(o,0,0,this); } public boolean imageUpdate(Image m, int f,int x, int y, int w,int h) { System.out.println("x="+x+" y="+y+" w="+w+" h="+h+" flags="+f); return true; } }
Program 4public boolean imageUpdate(Image m, int f,int x, int y, int w,int h) { System.out.println("x="+x+" y="+y+" w="+w+" h="+h+" flags="+f); return false; }
Program 5public class zzz extends Applet { Image o; public void init() { o=getImage(getDocumentBase(),"joe.surf.yellow.small.gif"); } public void paint(Graphics g) { } public boolean imageUpdate(Image m, int f,int x, int y, int w,int h) { System.out.println("x="+x+" y="+y+" w="+w+" h="+h+" flags="+f); return true; } }
Program 6public class zzz extends Applet { Image o; public void init() { o=getImage(getDocumentBase(),"joe.surf.yellow.small.gif"); } public void paint(Graphics g) { g.drawImage(o,0,0,this); } public boolean imageUpdate(Image m, int f,int x, int y, int w,int h) { System.out.println("x="+x+" y="+y+" w="+w+" h="+h+" flags="+f); Graphics h; h=getGraphics(); h.drawImage(m,150,150,this); return true; } }
Program 7public class zzz extends Applet { Image o; public void init() { o=getImage(getDocumentBase(),"joe.surf.yellow.small.gif"); } public void paint(Graphics g) { g.drawImage(o,0,0,this); } public boolean imageUpdate(Image m, int f,int x, int y, int w,int h) { System.out.println("x="+x+" y="+y+" w="+w+" h="+h+" flags="+f); Graphics h; h=getGraphics(); h.drawImage(m,150,150,this); repaint(3000); return true; } }
public class zzz extends Applet { Image o; public void init() { o=getImage(getDocumentBase(),"joe.surf.yellow.small.gif"); } public void paint(Graphics g) { g.drawImage(o,0,0,this); } public boolean mouseDown(Event e,int x,int y) { repaint(); return true; } public boolean imageUpdate(Image m, int f,int x, int y, int w,int h) { return true; } }
After all that piddling, get to the next topic "Some sludge about images" or just mail your comments, feedback, suggestions et al to us.