Class StackPanel

java.lang.Object
All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, HasWidgets, HasWidgets.ForIsWidget, IndexedPanel, IndexedPanel.ForIsWidget, InsertPanel, InsertPanel.ForIsWidget, IsWidget, Iterable<Widget>
Direct Known Subclasses:
DecoratedStackPanel

public class StackPanel extends ComplexPanel implements InsertPanel.ForIsWidget
A panel that stacks its children vertically, displaying only one at a time, with a header for each child which the user can click to display.

This widget will only work in quirks mode. If your application is in Standards Mode, use StackLayoutPanel instead.

CSS Style Rules

  • .gwt-StackPanel { the panel itself }
  • .gwt-StackPanel .gwt-StackPanelItem { unselected items }
  • .gwt-StackPanel .gwt-StackPanelItem-selected { selected items }
  • .gwt-StackPanel .gwt-StackPanelContent { the wrapper around the contents of the item }

Example

public class StackPanelExample implements EntryPoint {

  public void onModuleLoad() {
    // Create a stack panel containing three labels.
    StackPanel panel = new StackPanel();
    panel.add(new Label("Foo"), "foo");
    panel.add(new Label("Bar"), "bar");
    panel.add(new Label("Baz"), "baz");

    // Add it to the root panel.
    RootPanel.get().add(panel);
  }
}

See Also: