以网格形式显示带有可折叠元素的对象

huangapple 未分类评论45阅读模式
英文:

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?

This is it!

huangapple
  • 本文由 发表于 2020年4月10日 19:25:39
  • 转载请务必保留本文链接:https://java.coder-hub.com/61139294.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定