Iaroslav Baranov
Iaroslav Baranov

Reputation: 1120

JTextPane.setText(JTextPane.getText()) clear gaps in HTML mode

When I use JTextPane and type some text in HTML editor mode

JTextPane textPane = new JTextPane();
textPane.setContentType("text/html");
//...
textPane.setText(textPane.getText());

Spaces at the beginning of lines are removed. Why?

Upvotes: 0

Views: 128

Answers (1)

Alexey Semenyuk
Alexey Semenyuk

Reputation: 3303

Try to use   for adding spaces at the beginning with text/html content type. This link describe approachs how add spaces in html: http://webdesign.about.com/od/beginningtutorials/qt/spaces-in-html.htm You can use one of them.

Upvotes: 1

Related Questions