开发者

Drop down content in JTable

开发者 https://www.devze.com 2023-02-21 17:12 出处:网络
I want to show all the categories i开发者_如何学编程n the database in each line of a JTable i have done that. Now when i click on the each row of JTable i need to show the list of products under it (c

I want to show all the categories i开发者_如何学编程n the database in each line of a JTable i have done that. 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. 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. Any ideas ?


You need TreeTable functionality. I bet this article will help you.


You will need to have the table model add/remove the subcategory rows when the button on the category is clicked.


You should look at NetBeans Outline. Here's an example that shows how it looks.

0

精彩评论

暂无评论...
验证码 换一张
取 消