SimpleFormLayout layout = new SimpleFormLayout();
layout.addGroup(new FieldGroup("Contact Details").setOptional(true).setKeys(
"address.street", "address.city", "address.country"
));
final FormPanel formPanel = new FormPanel(form, layout);
SimpleButton validateButton = new SimpleButton("Validate", new ClickHandler() {
public void onClick(ClickEvent event) {
formPanel.validate();
}
});
FlowPanel main = new FlowPanel();
main.add(formPanel);