I need a Container with similar JPanel
s lined up one below the other which can be selected. I could:
- Use a
JList
with a custom renderer but thoseJPanel
s would be passive elements, that's not what I want. - Implement my own Container with 'active'
JPanel
s but those would not be selectable. Or could they made selectable? Maybe aMouseListener
and access to the system default selected-background-colors could be a way but it seems a bit too much effort - Use a
JTable
orJTree
with custom cell editors rendering the 'active'JPanel
. But these active parts would only react at the 'second' click, first to activate the editor, second to perform the real action of theJPanel
. this is also not acceptable.
To get a more visual impression, here is an example of what this could mean:
A JList
containing list items which have each two functional JButtons
.