开发者

Java Swing table tree

开发者 https://www.devze.com 2023-03-29 01:47 出处:网络
When you open a XML in Eclipse, the content can be shown in as a tree structure like The tree is "embedded" in a table and the content is showed in a seperate column.

When you open a XML in Eclipse, the content can be shown in as a tree structure like

Java Swing table tree

The tree is "embedded" in a table and the content is showed in a seperate column.

This would be very nice to replicate i开发者_运维知识库n Swing, not for XML content specifically, but for similar data with tree structure.

UPDATE

I just learned about JTreeTable, but I really need to do this in NetNeans. Should probably have mentioned that, sorry.

Any ideas?


SwingX has a JXTreeTable, it's based on but much improved over the oldish examples (links to sun code/article) cited by @mKorbel


Check the following:

  • TreeTable
  • This example
  • Code depots by Swing Guru
  • Netbeans IDE's Outline
  • Something more here
  • Commercial products


You could try subclassing JTable and making your own custom renderer with behavior that adds/removes new rows when you expand/collapse a node.

0

精彩评论

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

关注公众号