File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maintaining paragraph in HTMLEditorKit

 
Mathias Nilsson
Ranch Hand
Posts: 367
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I use a JTextPane, HTMLEditorKit to let the user do bold, italic and so forth. sometimes when the user saves the document the <p></p> is missing?

Normally when you make a new document from the editor kit you get <html><body><p></p></body></html> but sometimes the <p></p> tag is missing. Is there any way to get this to work in 100%?

// MAthias
 
Craig Wood
Ranch Hand
Posts: 1535
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure you are not replacing the logical style when modifying a paragraph style. Retaining the Logical Style When Setting a New Paragraph Style
 
Mathias Nilsson
Ranch Hand
Posts: 367
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks but it doesn't work!

Here's my problem.

When I create a new document the <p> tag is missing. If a begin typing a <p> tag creates.
If I delete all the text by pressing backspace the <p> tag get removed when the last letter is gone?!

Please help
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic