views:

33

answers:

2

I am creating a XMl editor. I want the JeditorPane to have expand collapse feature accoring to nodes.. If anybody is having any idea how to do it please tell...

+1  A: 

You might look at org.netbeans.swing.outline, as discussed in this answer. Because Outline extends JTable, custom rendering is relatively easy. I'd put an Outline on the left and a JEditorPane on the right of a JSplitPane; use a ListSelectionListener to update the JEditorPane accordingly.

trashgod
+1  A: 

That's an example of folding code. http://java-sl.com/collapse_area.html and one more exmple of XMLEditorKit (with expanding/collapsing nodes) http://java-sl.com/xml_editor_kit.html

Regards, Stas

StanislavL