在 JTree 节点内创建 JTable

发布于 2024-12-02 03:33:47 字数 968 浏览 0 评论 0原文

我知道以前有人问过这个问题,但我没有得到正确的解决方案。
我读到了关于大纲的内容,但这与我想要的相反,即 JTree 内的 JTable
我想在 JTable 中显示数据,但它存储为不同的组,所以这些组
是 JTree 的节点,当我消耗一组(节点)时,会显示该组的 JTable。

我在 oracle 中浏览了这篇文章:在 Swing 中创建 TreeTables:第 1 部分

这是相当旧的,不能在我的 java 版本上工作(我不知道为什么!),所以我去了
通过 TreeTable 的下一部分:在 Swing 中创建 TreeTables:部分2

整个代码相对较新,因为它使用“javax.swing”代替
“com.sun.java.swing”,但我在这里遇到的问题是一个名为
的文件 “FileSystemModel2.java”丢失,它是从以前的版本修改的,所以我无法工作
与旧的一样。新的“FileSystemModel.java”中添加了一些方法。我如何通知
他们关于这个丢失的文件,或者如果您有不同的方法,请告诉我。

我想要实现的目标如下图所示:


Image Implementing JTreeTable

这张图片来自“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 :


Image implementing JTreeTable

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

老子叫无熙 2024-12-09 03:33:47

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文