It's been awhile since I've done this (JDK 1.1 - no Swing), but try this:

import java.awt.Graphics;
import java.awt.Image;
import java.applet.*;

public class GetImage extends Applet {
    Image img;

    public void init() {
        img = getImage( getCodeBase(), "images/whatever.jpg");
    }

    public void paint( Graphics g) {
        int iWidth = img.getWidth( this);
        int iHeight = img.getHeight( this);
        int xPos = 10;
        g.drawImage( img, xPos, 10, iWidth, iHeight, this);
    }
}

Cheers!
Mark

----- Original Message -----
From: "MONICA GARCIA QUESADA" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 21, 2001 11:01 AM
Subject: Images jpg


Hello,

does anybody knows how to include an imagen (  jpg)  in an apllet?

Thank you,

M�nica Garc�a Quesada
Mercados y Tecnolog�as
Grupo Desarrollo Internet
SOLUZIONA TELECOMUNICACIONES
SERVICIOS PROFESIONALES DE UNI�N FENOSA
Infanta Mercedes, 31 -2� Pl.
28020 MADRID
TEL.: 915793000
FAX 915790708
E-MAIL: [EMAIL PROTECTED]
www.soluziona.com
www.ipt.es

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to