Swing GUI... Is it a bug?

I have created one JPanel (with BorderLayout), then put second and third JPanels on it at NORTH and CENTER positions respectively, then i put JSplitPane between them, everything is ok. But when i tried to put third at SOUTH posion and another SplitPane between third and last JPanels i could see just last two JPanels and last JSplitPane. So may be on one JPanel there can only one JSplitPane.

[414 byte] By [SeaverDeath] at [2007-9-26 2:44:40]
# 1

Hi

BorderLayout just accept 5 Components (in your example: JPanel) (North, South, West, East and Center). Each of this region can take again a Panel with BorderLayout. In this new Region u may place your elements.

The Idea is you have build a nested Layout with BorderLayout or u go to GridBagLayout (but this LayoutManager is not easy to handle).

Munot

Munot at 2007-6-29 10:25:17 > top of Java-index,Archived Forums,Swing...
# 2

So, I tried to use GridBagLayout. But every component is fixed length and width, and SplitPanes not working at all, and no alignment at owner component. src:

c.anchor = GridBagConstraints.NORTH;

c.fill = GridBagConstraints.BOTH;

c.gridwidth = GridBagConstraints.REMAINDER;

gridbag.setConstraints(this.resTreePanel, c);

this.add(this.resTreePanel);

by the idea, the resTreePanel must apear aligned to top of the parent component but it's placed at center, what i'am doing wrong?

SeaverDeath at 2007-6-29 10:25:17 > top of Java-index,Archived Forums,Swing...