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 jlaba...@google.com On Thu, Jan 13, 2011 at 6:31 AM, Leung <leung1_2...@yahoo.com> 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 google-web-toolkit@googlegroups.com. > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2bunsubscr...@googlegroups.com> > . > 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 google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.