code: private void addDefaultSubmitButtonExample() {
  		add(new WHeading(HeadingLevel.H3, "Default submit button"));
  
  		add(new ExplanatoryText(
  				"This example shows how to use an image as the only content of a WButton. "
  				+ "In addition this text field submits the entire screen using the image button to the right of the field."));
  		// We use WFieldLayout to lay out a label:input pair. In this case the input is a
  		//compound control of a WTextField and a WButton.
  		WFieldLayout imageButtonFieldLayout = new WFieldLayout();
  		imageButtonFieldLayout.setLabelWidth(25);
  		add(imageButtonFieldLayout);
  		// the text field and the button both need to be defined explicitly to be able to add them into a wrapper
  		WTextField textFld = new WTextField();
  		//and finally we get to the actual button
  		WButton button = new WButton("Flag this record for follow-up");
  		button.setImage("/image/flag.png");
  		button.getImageHolder().setCacheKey("eg-button-flag");
  
  		button.setActionObject(button);
  		button.setAction(new ExampleButtonAction());
  		//we can set the image button to be the default submit button for the text field.
  		textFld.setDefaultSubmitButton(button);
  		//There are many way of putting multiple controls in to a WField's input.
  		//We are using a WContainer is the one which is lowest impact in the UI.
  		WContainer imageButtonFieldContainer = new WContainer();
  		imageButtonFieldContainer.add(textFld);
  		//Use a WText to push the button off of the text field by an appropriate (user-agent determined) amount.
  		imageButtonFieldContainer.add(new WText("\u2002")); //an en space is half an em. a none-breaking space \u00a0 could also be used but will have no effect on inter-node wrapping
  		imageButtonFieldContainer.add(button);
  		//Finally add the input wrapper to the WFieldLayout
  		imageButtonFieldLayout.addField("Enter record ID", imageButtonFieldContainer);
  	}
docs: Examples showing how to set a WButton as the default submit button for an input control.