dcsimg
Weird text align after inserting lists and tables to HTMLEditorKit
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Karg_Johnson
Posted On:   Thursday, August 23, 2001 12:22 AM


I've been developing a WYSIWYG/HTML HTML-editor applet using JEditorPane, HTMLEditorKit and HTMLDocument.


When I use InsertHTMLTextAction() to create an ordered or unordered list the number or bullet is in normal place but list items text alignment is like "centered". How can I avoid this? It's quite annoying. The same thing happens also when inserting table cells. After saving and re-opening the the file list items and table cells are aligned correctly.

Re: Weird text align after inserting lists and tables to HTMLEditorKit

Posted By:   Torben_Vesterager  
Posted On:   Friday, January 18, 2002 06:19 AM


Hi,






I encountered the same problem. One solution is to insert a


element:






public static final String INSERT_UL_HTML =
"

";






new HTMLEditorKit.InsertHTMLTextAction( "InsertUnorderedListItem",
INSERT_UL_HTML, HTML.Tag.UL, HTML.Tag.LI, HTML.Tag.BODY,
HTML.Tag.UL).actionPerformed( evt);






This however will cause a new 'feature': When [Enter] is hit, a new
paragraph is inserted instead of a new

  • !

  • About | Sitemap | Contact