更新时间:2023-12-03 14:33:22
您可以使用 HTML
in JLabels
。要使用它,您的文字必须以< html>
开头。
You can use HTML
in JLabels
. To use it, your text has to start with <html>
.
将文字设为< html>这是< br>多行字符串
,它应该有效。
Set your text to "<html>This is<br>a multi-line string"
and it should work.
参见 Swing教程:JLabel 和多行标签(HTML)以获取更多信息。
See Swing Tutorial: JLabel and Multiline label (HTML) for more information.