How to load an image in applet

import java.applet.*;
import java.awt.*;
/*<applet code="DrawImage1" width=280 height=280>
<param name="file1" value="Blue hills.jpg">

</applet>
*/

public class DrawImage1 extends Applet {
    Image[] image=new Image[1];
    public void init(){
        image[0]=getImage(getDocumentBase(),getParameter("file1"));
       
    }
    public void paint(Graphics g){

        g.drawImage(image[0],0,0,this);
    }
       
}

Related product you might see:

Share this product :

Post a Comment

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. TECHBEAN stars - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger