I am creating a XMl editor. I want the JeditorPane to have expand collapse feature accoring to nod开发者_JS百科es.. If anybody is having any idea how to do it please tell...
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
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.
精彩评论