Label Text Wrap

How do I get the text in a IconicNode label to wrap? “\n” does not work.

private void setTaskText() {
    StringBuffer shownText = new StringBuffer(currentTask.getDescription());
    shownText.append("\n[42](363){N,D}");
    if (showCounts) {
        shownText.append(" [ ");
        shownText.append(currentTask.getItemCount());
        shownText.append(" ]");
    }
    if (showMinutes) {
        shownText.append(" ( ");
        shownText.append(currentTask.getCurrentEstimatedWorkLoad().getTotalMinutes());
        shownText.append(" )");
    }
    this.getLabel().setWrapping(true);
    this.getLabel().setMultiline(true);
    this.getLabel().setAlignment(Center);
    this.getLabel().setText(shownText.toString());
    this.update();
}

The append is just for testing but it still puts it on the same line. There are a whole bunch of issues with setting the wrap width such as if the appended text is longer than the name. Thanks.

If you want to use \n characters, setMultiline(true), but don't setWrapping(true).
If you do setWrapping(true), wrapping will occur when the text is longer the WrappingWidth property and will occur only if both isWrapping() and isMultiline is true. It will also attempt to break the line at a space character.
By the way, I'm not sure what the definition of Center is in your example above, but if it is JGoText.ALIGN_CENTER, that should be fine.

Thanks, that worked great. I must have tried every combination but that one. :)
Yea, they are the same.