Wednesday, January 21, 2015

Display image using Applet in java pgm



Display image using Applet

import java.applet.*;
import java.awt.*;          
public class appletImage extends Applet
  {
   Image img;
   MediaTracker tr;
   public void paint(Graphics g)
  {
      tr = new MediaTracker(this);
      img = getImage(getCodeBase(), "demoimg.gif");
      tr.addImage(img,0);
      g.drawImage(img, 0, 0, this);
   }
}

 

No comments:

Post a Comment