Java Applet Question.

Zombie

Platinum Member
Dec 8, 1999
2,359
1
71
Is there a way for me to set a background Image for an Applet ?(using cardlayout if that matters).


thanks.
 

Templeton

Senior member
Oct 9, 1999
467
0
0
I'm pretty sure Panels don't have any facility to set a background image, you can however override the paintComponent method of Panel and draw the image yourself. If you need to do this on multiple panels, make a new subclass of Panel to handle this for you. See the Graphics class in the api for how to draw an image, there are some good tutorials on graphics at java.sun.com if you look around as well.
 

Zombie

Platinum Member
Dec 8, 1999
2,359
1
71
Ok so here's the thing.

I am able to draw the image but it draws on top of all my text fields and JTree objects thus hiding everything under it.


any idea how I can around this ?