This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Is it possible to set the z order value for a JComponent? I have a custom layout manager and some of my components overlap the problem is that the components are being drawn on top of each other in the wrong order. Thanks Kory [ March 12, 2002: Message edited by: Kory Spansel ]
Since the content pane is contained in a JLayeredPane you can add the JComponentcomponent to layer 10 by calling,
on your JFrame. The JavaDocs say that you should do this before actually adding the component to the content pane.
You can also do this with :
But since you are using a custom layout manager the first option may meet your needs better.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Joined: Mar 05, 2002
Thanks for the reply but I don't think thats exactly what I'm looking for. Basically what I have is a class derived from a JComponent called StandardCard and I also have a class called CardTable derived from JPanel in which I add my StandardCards to. So I wanted to write a layout manager for the CardTable class to use. And then I will place the card table class, along with some other stuff onto a JFrame. So basically I don't have a JLayeredPane component. I have no problems setting the bounds of each component within the layout manager it's just that it draws the first component on top and the successive components underneath the previous one. It looks like your holding your poker hand upside down Kory