Search Here

Java program to display Image


import java.awt.*;  
import java.applet.*;  
  
/*
    <applet code=image height=400 width=550>
    </applet>
*/

public class image extends Applet 
{  
    Image picture;  
    public void init() 
    {  
        String image_path = "wbsu.jpg"; // Give full image path
        picture = getImage(getDocumentBase(),image_path);  
    }  
    
    public void paint(Graphics g) 
    {  
        g.drawImage(picture, 30,30, this);  
    }        
} 

No comments:

Post a Comment