在 JTree 节点内创建 JTable
我知道以前有人问过这个问题,但我没有得到正确的解决方案。
我读到了关于大纲的内容,但这与我想要的相反,即 JTree 内的 JTable
我想在 JTable 中显示数据,但它存储为不同的组,所以这些组
是 JTree 的节点,当我消耗一组(节点)时,会显示该组的 JTable。
我在 oracle 中浏览了这篇文章:在 Swing 中创建 TreeTables:第 1 部分
这是相当旧的,不能在我的 java 版本上工作(我不知道为什么!),所以我去了
通过 TreeTable 的下一部分:在 Swing 中创建 TreeTables:部分2
整个代码相对较新,因为它使用“javax.swing”代替
“com.sun.java.swing”,但我在这里遇到的问题是一个名为
的文件 “FileSystemModel2.java”丢失,它是从以前的版本修改的,所以我无法工作
与旧的一样。新的“FileSystemModel.java”中添加了一些方法。我如何通知
他们关于这个丢失的文件,或者如果您有不同的方法,请告诉我。
我想要实现的目标如下图所示:
这张图片来自“LastPass”,我想制作自己的密码管理器作为我的项目
所以请帮助我解决这个问题,我已经很接近了,但我无法进一步前进。
I know that this question is being asked before but I did not get proper solution.
I read about outline but that was just opposite of what I want i.e. JTable inside JTree
I want to display data in a JTable but it is stored as different groups,so these groups
are node of JTree when I expend one group(node) the JTable of that group is shown.
I went through this article in oracle :Creating TreeTables in Swing:part 1
This was pretty old and not working on my version of java(I don't know why !),so I went
through the next part of TreeTable :Creating TreeTables in Swing: Part 2
The whole code was comparatively new, as it was using "javax.swing" in place of
"com.sun.java.swing" but the problem I faced here was one file named as
"FileSystemModel2.java" was missing it is modified from previous version so I can't work
with old one.There are some method added to new "FileSystemModel.java".How do I inform
them about this missing file or if you have different approach please let me know.
What I want to achieve is shown in picture below :
This image was from "LastPass" and I want to make my own password manager as my project
So please help me with this I am so close but yet I can't move further.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SwingX项目包含一个现成的TreeTable
http://swingx.java.net/
下载有点难找,所以这是链接:
http://java.net/downloads/swingx/releases/1.6.2/
一篇简短的文章有关使用该组件的信息可以在这里找到:
http://sandarenu.blogspot.com/2008/02/treetable-in- java-using-swingx.html
The SwingX project contains a ready-made TreeTable
http://swingx.java.net/
The downloads are a bit hard to find, so here is the link:
http://java.net/downloads/swingx/releases/1.6.2/
A short article about using that component can be found here:
http://sandarenu.blogspot.com/2008/02/treetable-in-java-using-swingx.html