File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes SWT - Wrap label Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "SWT - Wrap label" Watch "SWT - Wrap label" New topic

SWT - Wrap label

Paul Speijers

Joined: Apr 10, 2005
Posts: 8
I've been trying to use a label, but the label text won't wrap. The text is just clipped off at the right of the label.
I simply instantiate it using:

Label label = new Label(composite, SWT.WRAP);

I'm using the label within a composite, which is in a flowlayout.

I'm using the SWT version included with Eclipse 3.0.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

My code works fine:

Care to show us your code?

GenRocket - Experts at Building Test Data
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
A wild guess: it may be a problem with the Layout and LayoutData you are using.

:alex |.::the_mindstorm::.

blog -
I agree. Here's the link:
subject: SWT - Wrap label
It's not a secret anymore!