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.*;
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);
}
}
Program 2
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 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 3
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 false;
}
Program 4
public 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 5
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 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 6
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 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;
}
}
Program 7
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.