I advise you subclass a FlowPanel.
Exemple (to head) :
class InputTextBox extends FlowPanel {
public InputTextBox(String labelText) {
super();
Label label = new Label(labelText);
TextBox input = new TextBox();
this.add(label);
this.add(input);
this.addStyleName("myBox");
}
}
It's give that:
<div class="myBox">
<div class="gwt-Label">Nom :</div>
<input type="text" tabindex="1" class="gwt-TextBox"/>
</div>
Exemple of css:
.myBox {
float: left; width: 200px;
}
.myBox .gwt-Label {
float: left;
width: 200px;
}
.myBox .gwt-TextBox {
float: left; width: 200px;
}
Maybe with GWT 2, Label class will generate a label node in the DOM ?