Peter Penzov
Peter Penzov

Reputation: 1668

New line for label

I have a Label which I want to shrink into the space. In my case I want to write the text in two lines:

2. New Connection 
Credentials

I Tested this but the result is not accomplished:

    Label lbb = new Label("2. New Connection Credentials");
    lbb.setMaxWidth(10);
    lbb.setTextOverrun(OverrunStyle.CLIP);

How I can split the string into two lines if the size exceeds 10 letters?

Upvotes: 2

Views: 2031

Answers (1)

Lukas Eichler
Lukas Eichler

Reputation: 5903

Use lbb.setWrap(true) to activate text wrapping.

Upvotes: 6

Related Questions