component on a background image

Hello

I would like to know how to display a JComponent in a JApplet.

I created the button and added it in the JApplet. I overrided the paint method, and I am using an image as a background.

The background is displayed on top of the component, which makes it invisible.

Is there a way of displaying the component on top of the background image?

Regards

[389 byte] By [Kelsa] at [2007-10-3 2:19:58]
# 1
The best way is probably using a JLayeredPane.Never overwrite the paint method in Swing!
Wildcard82a at 2007-7-14 19:18:52 > top of Java-index,Java Essentials,New To Java...
# 2
Thank youI will try to use that.You said not to overwrite the paint method. The only way I know hot to draw shapes, or images in a component is by overriding the paint method.Is there any other way of doing it?Regards
Kelsa at 2007-7-14 19:18:52 > top of Java-index,Java Essentials,New To Java...
# 3
In Swing you override the painComponent, and usually you have to invoke super.paintComponent(g) as the first statement
Wildcard82a at 2007-7-14 19:18:52 > top of Java-index,Java Essentials,New To Java...
# 4
Thanks very much!I am going to try all this in my program.Hopefully it will work.
Kelsa at 2007-7-14 19:18:52 > top of Java-index,Java Essentials,New To Java...