Question

I would like to break a long line of text assigned to the standard Label widget in GWT. I was experimenting with inline <br /> elements but with no success.

Something like this:

label = "My very very very long<br />long long text"
Was it helpful?

Solution

You need to use the HTML widget, which extends the standard Label widget, and adds support for interpreting HTML tags.

See the JavaDoc.

OTHER TIPS

I would use CSS to style the label to fit a given with and drop the <br/> all together.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top