//Only display the number of characters that have been entered
private void attachDisplayLengthHandler( final TextBox box ) {
int length = box.getText().length();
box.setVisibleLength( length > 0 ? length : 1 );
box.addKeyUpHandler( new KeyUpHandler() {
public void onKeyUp( KeyUpEvent event ) {
int length = box.getText().length();
box.setVisibleLength( length > 0 ? length : 1 );
}