2010-09-12 55 views
1

我試圖設置下面給出的文本,但由於某種原因,JEditorPane不能識別 \n並將所有內容打印在一行中。JEditorPane中的NewLine

this.jEditorPane2.setText("Hello how is the weather in \n California"); 

有什麼辦法可以獲得新的行空間嗎?

回答

4

JEditorPane應該支持HTML,請嘗試使用<br>代替\n