Forums Register Login

JLayeredPane + JPanel problem

+Pie Number of slices to send: Send
I tried to overlay 2 buttons over the JLayeredPane. So that 2 buttons can be rendered over the title bar.



But the buttons' and JPanel's Z-orders are wrong, which the image is behind the Buttons, I'd like to see the image thru the JPanel's.
How can I do that?
Thanks
Jack
+Pie Number of slices to send: Send
Read the Swing tutorial on How to Use Layered Panes for working examples.

You need to specify an Integer value when you add components to the layered pane to control the order in which components are painted. Also I would not extend JLayeredPane. Just add compnents to it.

Post your SSCCE demonstrating the problem if you need more help.
+Pie Number of slices to send: Send
 

Rob Camick wrote:Read the Swing tutorial on How to Use Layered Panes for working examples.

You need to specify an Integer value when you add components to the layered pane to control the order in which components are painted. Also I would not extend JLayeredPane. Just add compnents to it.

Post your SSCCE demonstrating the problem if you need more help.



Got it working, by setting setOpaque to false for the JPanels
no wonder he is so sad, he hasn't seen this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1612 times.
Similar Threads
create a jtable which can combine and split and the image change also
How do read a double datatype 2D array into your applet code from a text file
Painting components over images
Swing GUI wierdness
gridlayout - set size
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 10:36:56.