New line for label
Question
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?
Solution
Use lbb.setWrap(true)
to activate text wrapping.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow