How to add a LayoutManager to JLayeredPane

All,

I'm facing a little dilemna using the JLayeredPane. I would like to add a dynamic number of JTextPane instances onto a JLayeredPane. What I'm currently doing is creating a JPanel to use BoxLayout. Then for the n number of JTextPane instances I have, I add them to the JPanel. I then add the JPanel to the JLayeredPane using the add(Component c, Integer layer) method in JLayeredPane. The problem is nothing shows up under this approach and using a debugger I find that the width and height of the components are all 0.

What would be nice is to use a LayoutManager on JLayeredPane, but there is no setLayout method within the class. I don't want to use setBounds or setSize or setPreferredSize to place Components inside the JLayeredPane because the Components are subject to resizing (since the JLayeredPane is resizable).

Any thoughts on this? Has anyone encountered similar problems with JLayeredPane?

Thanks in advance for tips, help.

[983 byte] By [collinl] at [2007-9-26 1:19:44]
# 1
I'm an idiot! Okay, there is a setLayout method in JLayeredPane since it subclasses Container. :)
collinl at 2007-6-29 0:52:37 > top of Java-index,Archived Forums,Swing...