英文:
Display objects in grid with collapsible elements
问题
我有一些带有多个元素的对象,我想在网格中显示它们。每个对象应该是一行,列应该是:
Object.name/category | Button | Object.targetLocation | Object.notes
在Object.name列中,我还需要一个标签,即它应该是这样的:
Category1
Name1
Name2
Name3
Category2
Name4
...
每个类别和相应的行都可以折叠/展开。
我对应该在这里使用什么类型的Swing元素毫无头绪。也许GridBagLayout会起作用,但我不确定是否可以实现类别的折叠/展开。是否有任何简单的方法可以在不过多编码的情况下实现这一点?
英文:
I have some Objects with multiple elements that I'd like to display in a grid. Every object should be a row and the columns should be:
Object.name/category | Button | Object.targetLocation | Object.notes
In the Object.name column I also need a tab, i.e. it should look like this:
Category1
Name1
Name2
Name3
Category2
Name4
...
Where each Category and the corresponding rows can be collapsed/expanded.
I have zero idea with what kind of swing element(s) I should work here. Perhaps a GridBagLayout would work, but I'm not sure about the collapsing/expanding of categories with that. Is there any simple way to do this without excessive coding?
专注分享java语言的经验与见解,让所有开发者获益!
评论