A WGroupBox corresponds to an HTML
<fieldset>
element, and provides a frame and
title around a group of widgets.
It is usually styled using the CSS stylesheet which provides many options for layout of the legend (title) and the box contents.
A WPanel is similar to a group box, but provides optional functionality to collapse or expand its contents, and a theme-based style.
void PanelNoTitle() {
WPanel panel = new WPanel();
panel.addStyleClass("centered-example");
panel.setCentralWidget(new WText("This is a default panel."));
}
void Panel() {
WPanel panel = new WPanel();
panel.addStyleClass("centered-example");
panel.setTitle("Terrific panel");
panel.setCentralWidget(new WText("This is a panel with a title."));
}
void PanelCollapsible() {
WPanel panel = new WPanel();
panel.setTitle("Collapsible panel");
panel.addStyleClass("centered-example");
panel.setCollapsible(true);
WAnimation animation =
new WAnimation(AnimationEffect.SlideInFromTop, TimingFunction.EaseOut, 100);
panel.setAnimation(animation);
panel.setCentralWidget(new WText("This panel can be collapsed."));
}