简体   繁体   English

下载JTable中的内容

[英]Drop down content in JTable

I want to show all the categories in the database in each line of a JTable i have done that. 我想在JTable的每一行中显示数据库中的所有类别。 Now when i click on the each row of JTable i need to show the list of products under it (considered as child of the category) as a drop down not as a drop down list which closes automatically when focus is lost, but it should stay there until i click on minimize icon in the same row. 现在,当我点击JTable的每一行时,我需要显示其下的产品列表(被视为该类别的子项)作为下拉列表而不是作为下拉列表,当焦点丢失时自动关闭,但它应该保持直到我点击同一行中的最小化图标。 It is just like expanding content. 这就像扩展内容一样。 so i can expand all categories individually. 所以我可以单独扩展所有类别。 The working is similar to JTree but i need it in JTable so that i can show more information on each row in a proper format. 工作类似于JTree,但我需要它在JTable中,以便我可以以适当的格式显示每行的更多信息。 Any ideas ? 有任何想法吗 ?

You need TreeTable functionality. 您需要TreeTable功能。 I bet this article will help you. 我打赌这篇文章会对你有所帮助。

单击类别上的按钮时,您需要让表模型添加/删除子类别行。

You should look at NetBeans Outline . 您应该查看NetBeans Outline Here's an example that shows how it looks. 这是一个展示它外观的例子

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

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