thomas
Posts: 42
Nickname: turbomanic
Registered: Jul, 2002
|
|
help with adding image to applet
|
Posted: Aug 8, 2002 7:44 AM
|
|
Advertisement
|
this is my code: import java.awt.*; import java.applet.Applet;
/* * This applet displays a single image twice, * once at its normal size and once much wider. */
public class ImageDisplay extends Applet { Image image;
public void init() { image = getImage(getCodeBase(), "rocketguy.gif"); }
public void paint(Graphics g) { //Draw image at its natural size first. g.drawImage(image, 0, 0, this); //85x62 image
//Now draw the image scaled. g.drawImage(image, 90, 0, 300, 62, this); } } error comes up saying incompatable type required Image get java.awt.Image
I got both programme and picture file in the same folder but not uploaded on net. can anyone tell me what is wrong?
|
|