如何使JLabel自动换行到下一行

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何使JLabel自动换行到下一行相关的知识,希望对你有一定的参考价值。

  1. JLabel myLabel;
  2. String myString =
  3. "<html><p>This is a long paragraph and I want it to break on its own. " +
  4. "This is a long paragraph and I want it to break on its own. " +
  5. "This is a long paragraph and I want it to break on its own. " +
  6. "This is a long paragraph and I want it to break on its own.</p></html>";
  7. myLabel = new JLabel(myString);

以上是关于如何使JLabel自动换行到下一行的主要内容,如果未能解决你的问题,请参考以下文章