Java Swing 表树
当您在 Eclipse 中打开 XML 时,内容可以显示为树结构,如
树是 "嵌入”表格中,内容显示在单独的列中。
这在 Swing 中复制会非常好,不是专门针对 XML 内容,而是针对具有树结构的类似数据。
更新
我刚刚了解了 JTreeTable,但我确实需要在 NetNeans 中执行此操作。也许应该提到这一点,抱歉。
有什么想法吗?
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.
This would be very nice to replicate in 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
SwingX 有一个 JXTreeTable,它基于引用的旧示例(链接到 sun 代码/文章),但比它有很大改进通过@mKorbel
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:
您可以尝试对 JTable 进行子类化并制作自己的 自定义渲染器当您展开/折叠节点时添加/删除新行的行为。
You could try subclassing JTable and making your own custom renderer with behavior that adds/removes new rows when you expand/collapse a node.