Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

colored xml display in swing

Is there an "easy" way to display xml data to a user via an JEditorPane or JTextPane in colored/highlighted way?

like image 439
Cratylus Avatar asked Nov 05 '10 19:11

Cratylus


2 Answers

http://java-sl.com/xml_editor_kit.html You can try this as well.

like image 180
StanislavL Avatar answered Sep 30 '22 09:09

StanislavL


An example of XMl Syntax Highligthing for JTextPane you find here

It's a good link, the TAG_PATTERN regex should be enhanced.

Just replace (</?[a-z]*)\\s?>? by (</?\\w+)\\s*>? and it should work perfectly !

like image 42
stacker Avatar answered Sep 30 '22 07:09

stacker