I have a list of items in a JList
for the user to select. Since it's a lot of items (say, cities in states), I want to divide the list into sections. The section headings should not be selectable, though. So for my cities/states example, this might look like this:
- State 1
- City 1
- City 2
- City 3
- State 2
- City 4
- City 5
- City 6
It wouldn't be so difficult to write this myself by embedding JList
s in a custom ListCellRenderer
, but I'm wondering if there already is a class like that out there.