size of TextBox in GWT

2,890 views
Skip to first unread message

Tobe

unread,
Aug 6, 2009, 2:59:59 PM8/6/09
to Google Web Toolkit
Hi,
how do I set the size parameter of a HTML input element with
type="text" for a TextBox in GWT?

Michael W

unread,
Aug 6, 2009, 9:34:56 PM8/6/09
to Google Web Toolkit
user TextBox method setMaxLength(...)

Tobe

unread,
Aug 7, 2009, 8:51:32 AM8/7/09
to Google Web Toolkit
@Michael
I want to change the size and not the maxlength of the TextBox

Looks like setSize() and setPixelSize() aren't changing the number of
visual characters, too.

On Aug 7, 3:34 am, Michael W <mwang_2...@yahoo.com> wrote:
> user TextBox method setMaxLength(...)
>

Thad

unread,
Aug 7, 2009, 12:46:12 PM8/7/09
to Google Web Toolkit
It may be whatever container/panel that you have text box in is
overriding the size. Such are the joys of HTML and CSS.

Tobe

unread,
Aug 7, 2009, 3:43:05 PM8/7/09
to Google Web Toolkit
But issn't it better to set the size attribute of the HTML element to
have the number of visual characters? How can I do the same in CSS?
How do I know how much pixel (width) has one character?

On Aug 7, 6:46 pm, Thad <thad.humphr...@gmail.com> wrote:
> It may be whatever container/panel that you have text box in is
> overriding the size.  Such are the joys of HTML and CSS.
>

jhulford

unread,
Aug 8, 2009, 12:51:07 PM8/8/09
to Google Web Toolkit
Try TextBox.setVisibleLength()

Tobe

unread,
Aug 10, 2009, 8:59:46 AM8/10/09
to Google Web Toolkit
@jhulford
That's what I need. Thanks
Reply all
Reply to author
Forward
0 new messages