tags:

views:

29

answers:

2

i want to display a regular XML or any other file in text format in JEditorPane..i dont want to display the content in html page... the content should be exactly the same as in file with line break..the XML file is located on local system

+1  A: 

JEdit can work with XML. It does syntax highlighting, too.

Oops! Now I see you wanted a JEditorPane. I don't know if you can embed JEdit, but it might still be useful.

Catalina Island
+1  A: 

Do you need syntax highlighting? or just show plain text?

If syntax try to use this http://java-sl.com/xml_editor_kit.html

If not just use JTextArea or normal JEditorPane with default editor kit. And call setText() to set your content.

StanislavL