Is there an "easy" way to display xml data to a user via an JEditorPane or JTextPane in colored/highlighted way?
colored xml display in swing
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 !
http://java-sl.com/xml_editor_kit.html You can try this as well.
Very interesting site!Thank you.Is it yours? Are there any licensing on your projects? –
Kurth
No restrictions at all. You can use all the code as you wish. –
Backman
I tried to use the jar in Netbeans but it seems that it can not find the XMLEditorKit inside the xmleditorkit package. It sees only App,TagView,XMLDocument,XMLReader. So in the line editorPane.setEditorKit(new XMLEditorKit()); Netbeans marks as error and can not find XMLEditorKit in the xmleditor package. Any idea why? –
Kurth
I just opened the .jar file and see th XMLEditorKit.class. Try t check your imports or you can get all the sources from the .jar (see src directory) and add to you app as normal sources. –
Backman
hey @Backman i tried using your jar but i can no longer edit my xml anymore on the pane! can you please help me with the same! –
Blim
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 !
© 2022 - 2024 — McMap. All rights reserved.