seb2nim
4 Sep 2008, 4:33 AM
From : How to resize a BorderLayout Region programatically :
Seconded. We'd like to know how to collapse the regoin in code. This is useful for preview panes etc.
You this:
ContentPanel west = new ContentPanel();
west.getState().put("collapsed", true);
Sorry Darrel solution you suggest does not work.
It seems calling getState() just after constructor does not return the same object reference as when called within BorderLayout.onLayout().
Something i dond understand in initState() method from Component.
The only way i can set a panel initially collaped is to override Component 's initState() method :
protected void initState() {
super.initState();
getState().put("collapsed", true);
}But no way to programmatically/dynamically collapse or expand the panel after that (i mean using for example a 'toggle' button).
Can you be more precise ?
Seconded. We'd like to know how to collapse the regoin in code. This is useful for preview panes etc.
You this:
ContentPanel west = new ContentPanel();
west.getState().put("collapsed", true);
Sorry Darrel solution you suggest does not work.
It seems calling getState() just after constructor does not return the same object reference as when called within BorderLayout.onLayout().
Something i dond understand in initState() method from Component.
The only way i can set a panel initially collaped is to override Component 's initState() method :
protected void initState() {
super.initState();
getState().put("collapsed", true);
}But no way to programmatically/dynamically collapse or expand the panel after that (i mean using for example a 'toggle' button).
Can you be more precise ?