VerticalPanel is implemented using a table, which means that it will always auto expand to fit its contents. If you want to ensure that it is 400px, wrap each child content in a FlowPanel and set the width of the FlowPanel to 400px and overflow to hidden (or scroll).
Thanks, John LaBanca [email protected] On Thu, Jan 13, 2011 at 6:31 AM, Leung <[email protected]> wrote: > Hi > > I need to make the width of the VerticalPanel constant. I have tried > setwidth and setCellWidth, but both seem not working well. > > For example, > > VerticalPanel vp = new VerticalPanel(); > vp.setCellWidth(this, "400px"); > Label textlabel = new textlabel(); > textlabel.add(text); <-- > vp.add(textlabel); > > If the text is a string containing various spaces, then the width is able > to be kept because the wrap is on. Otherwise, if the text is a string > without space longer than 400px, the string would not wrap. How can I make > the width constant independent of the string? > > Thanks > > > > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-web-toolkit%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
