开发者

displaying a XML file in JEditorPane

开发者 https://www.devze.com 2023-01-14 09:47 出处:网络
I want to display a regular XML or any other file in text format in JEditorPane..I don\'t w开发者_高级运维ant to display the content in html page... the content should be exactly the same as in file w

I want to display a regular XML or any other file in text format in JEditorPane..I don't w开发者_高级运维ant 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消