开发者

expand collapse JeditorPane

开发者 https://www.devze.com 2023-01-20 09:50 出处:网络
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 foldi

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.

0

精彩评论

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