Skip to main content

Inserting image in java applet


import java.awt.*;
import java.awt.image.*;
import java.io.*;
import javax.imageio.*;


import java.applet.Applet;

/*<applet code="s" height=678 width=678></applet>
  */
public class s extends Applet
{

public void paint(Graphics g)
{
  try {
        g.drawImage(ImageIO.read(new File("s.jpg")), 0, 0, null);
// s.jpg is the image file which is present in the same folder as the java file
       }
catch (IOException e)
{ }
}
}

Comments

Popular posts from this blog

unix commands