Mohit Bansal
Mohit Bansal

Reputation: 1553

NewLine in JEditorPane

I was trying to set the text given below but for some reason JEditorPane is not recognizing \n and printing everything in a single line.

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

Is there any way to get a new line space?

Upvotes: 1

Views: 2276

Answers (1)

Mark Elliot
Mark Elliot

Reputation: 77074

JEditorPane should support HTML, try using <br> instead of \n.

Upvotes: 4

Related Questions