简体   繁体   English

在JTree的节点内创建JTable

[英]Creating JTable inside node of JTree

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 ie JTable inside JTree 我读了有关大纲的内容,但这与我想要的东西即JTree中的JTable相反
I want to display data in a JTable but it is stored as different groups,so these groups 我想在JTable中显示数据,但是将其存储为不同的组,因此这些组
are node of JTree when I expend one group(node) the JTable of that group is shown. 当我使用一组(节点)时,JTree的节点是JTree的节点,显示该组的JTable。

I went through this article in oracle : Creating TreeTables in Swing:part 1 我在oracle中浏览了这篇文章: 在Swing中创建TreeTable:第1部分

This was pretty old and not working on my version of java(I don't know why !),so I went 这已经很老了,无法在我的Java版本上使用(我不知道为什么!),所以我去了
through the next part of TreeTable : Creating TreeTables in Swing: Part 2 通过TreeTable的下一部分: 在Swing中创建TreeTable:第2部分

The whole code was comparatively new, as it was using "javax.swing" in place of 整个代码相对较新,因为它使用“ javax.swing”代替
"com.sun.java.swing" but the problem I faced here was one file named as “ com.sun.java.swing”,但是我在这里遇到的问题是一个名为
"FileSystemModel2.java" was missing it is modified from previous version so I can't work 缺少“ FileSystemModel2.java”,它已从以前的版本进行了修改,所以我无法工作
with old one.There are some method added to new "FileSystemModel.java".How do I inform 与旧的一样。新的“ FileSystemModel.java”中添加了一些方法。如何通知
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 : 我要实现的目标如下图所示:


实现JTreeTable的图像

This image was from "LastPass" and I want to make my own password manager as my project 该图像来自“ LastPass”,我想创建自己的密码管理器作为我的项目
So please help me with this I am so close but yet I can't move further. 所以请帮助我,我已经很近了,但是我不能再走了。

The SwingX project contains a ready-made TreeTable SwingX项目包含一个现成的TreeTable

http://swingx.java.net/ 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/ 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 http://sandarenu.blogspot.com/2008/02/treetable-in-java-using-swingx.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM