   [java] HTML in Java (JEditorPane)
  Hi there :-POk my problem is this:I have been developing a chat program in Java (uses RMI) well in reality it is SDK that sit atop of RMI to let my suite of Java Apps talk to each other (my map editor has a small chat program in that can talk to my pure chat program for example and send data between them) Anyways my problem is this:I want \ am using HTML formatting for the msgs. All I want to do is when a new msg is received it is formatted into a basic html string then added to the bottom of the JEditor pane. The text is not editable etc...But I cant get the html to go in the right place!. Currently I use this code:JEditorPane activePane =(JEditorPane)activePanel.getComponent(0);HTMLDocument doc = (HTMLDocument) activePane.getDocument();doc.insertAfterEnd(doc.getParagraphElement(msgCount),"< p>"+msg+"< /p>");msgCount++;  When I create the pane I am setting its content typr to text\html so thats fine. The HTML msgs seem to be displayed in random locations!Now I have never used JEditor pane before! is this the correct way to use it? Are there any native ways to display HTML formatted string in Java?Ive tried googling it but all I get is links to the javadocs. And I cant find any good info on the sun site.Please Help![edited by - Zidane on February 3, 2004 11:02:44 AM]