Control for displaying multiline text?

前端 未结 5 1443
旧巷少年郎
旧巷少年郎 2020-12-29 02:00

I need to display a multiline, read-only text - which control can be used for that? It should only display the text, like a Label does, however Label does not support multil

5条回答
  •  萌比男神i
    2020-12-29 02:21

    If you set a max width you want for your Label, then you set setWrapText to true so it displays the text multiline:

    Label label = new Label("Your long text here");
    label.setMaxWidth(180);
    label.setWrapText(true);
    

提交回复
热议问题