code: private void setup() {
  
  		setLayout(new FlowLayout(FlowLayout.VERTICAL));
  
  		WFieldSet fset = new WFieldSet("Select a meal");
  		add(fset);
  		fset.setMargin(new Margin(null, null, Size.LARGE, null));
  
  		WFieldLayout flay = new WFieldLayout(WFieldLayout.LAYOUT_STACKED);
  		fset.add(flay);
  		flay.setLabelWidth(0);
  		flay.addField("Breakfast", rb1);
  		flay.addField("Lunch", rb2);
  		flay.addField("Dinner", rb3);
  
  		/*
  		 * NOTE: you should never use submitOnChange with a WRadioButton
  		 */
  		fset.add(new WAjaxControl(mealSelections, textBox));
  
  		mealSelections.setActionOnChange(new Action() {
  			@Override
  			public void execute(final ActionEvent event) {
  				String selection = null;
  
  				if (rb1.isSelected()) {
  					selection = "Breakfast selected";
  				}
  
  				if (rb2.isSelected()) {
  					selection = "Lunch selected";
  				}
  
  				if (rb3.isSelected()) {
  					selection = "Dinner selected";
  				}
  
  				text1.setText(selection + " : " + (new Date()).toString());
  			}
  		});
  
  		textBox.add(text1);
  		add(textBox);
  		add(mealSelections);
  	}
docs: Add controls to the UI.