I need a Container with similar JPanels lined up one below the other which can be selected. I could:
- Use a
JListwith a custom renderer but thoseJPanels would be passive elements, that's not what I want. - Implement my own Container with 'active'
JPanels but those would not be selectable. Or could they made selectable? Maybe aMouseListenerand access to the system default selected-background-colors could be a way but it seems a bit too much effort - Use a
JTableorJTreewith 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.