Roughian Examples Site Map - GWT Examples - Tutorials

StackPanel


Version 1.0 onwards

A Stack Of SubPanels Wher One Opens At A Time



Notes


The StackPanel is a table-based widget that gives you an Outlook Bar type area. It gives you a list of headers, each of which has content of some sort, but only one is open at any one time. It is very similar to having a whole bunch of Disclosure panels except that you can only have one open at any point in time.


Code


String text1 = "Lorem ipsum dolor sit amet...";
String text2 = "Sed egestas, arcu nec accumsan...";
String text3 = "Proin tristique, elit at blandit...";
StackPanel panel = new StackPanel();
Label label;
label = new Label(text1);
panel.add(label, "One", false);
label = new Label(text2);
panel.add(label, "Two", false);
label = new Label(text3);
panel.add(label, "Three", false);
panel.setSize("400px", "200px");
panel.addStyleName("demo-panel");
RootPanel.get("demo").add(panel);