PDA

View Full Version : border layout add and remove



bauchinj
9 Nov 2009, 2:06 AM
I start with a window. This window extends a border layout. First, just center and east region are shown. After a click on a button, a function is called, which should transfer the context of center region to west region and show in center region a new context.

I thought it should work with:


ctrContainer.remove(panel,false);
ctrContainer.add({panelNew});
ctrContainer.doLayout();

westContainer.add(panel);
westContainer.doLayout();
First of all, I set width of westContainer to 0, but I had to do


westContainer.setWidth(westWidth);after setWidth on westContainer, ctrContainer apeared over westContainer, so I also set there a width and positioned it (setPosition).

But I already wrote, that I work with a window, so the user is able to resize it. Is it possible, to fix for instance the width of east and west region, and say, that center should be complete the width of the window?

Is it possible, to calculate the height automatically?

rgds