PDA

View Full Version : JAVA: how to insert an image into the applet.


sh00ter555
05-13-2005, 04:28 PM
ok, i got my applet window to appear. Now, how do i add an image to the applet so i can see something besides a blank white screen?

leptogenesis
05-25-2005, 06:21 PM
Take a look at the Image object

http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Image.html

Then you can draw an image using the (Graphics instance).drawImage() method.

Here's the Graphics object

http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Graphics.html