EXPERIMENT NO- 01
AIM- Program in java to load an image
import java.awt.*;
import java.applet.*;
import java.awt.Image;
/*<applet code="SimpleImageLoad" width=500 height=400>
</applet>
*/
public class SimpleImageLoad extends Applet {
Image img;
public void init()
{
img=getImage(getDocumentBase(),"YANA.jpg");
setVisible(true);
}
public void paint(Graphics g)
{
g.drawImage(img,0,0,this);
}
public static void main(String args[])
{
SimpleImageLoad ob=new SimpleImageLoad();
}
}
AIM- Program in java to load an image
import java.awt.*;
import java.applet.*;
import java.awt.Image;
/*<applet code="SimpleImageLoad" width=500 height=400>
</applet>
*/
public class SimpleImageLoad extends Applet {
Image img;
public void init()
{
img=getImage(getDocumentBase(),"YANA.jpg");
setVisible(true);
}
public void paint(Graphics g)
{
g.drawImage(img,0,0,this);
}
public static void main(String args[])
{
SimpleImageLoad ob=new SimpleImageLoad();
}
}
No comments:
Post a Comment
Thanks for comments.