I've got 1 JList using 4 Models. The list shows model depending on which one user chose from JComboBox. What I currently have is that list shows data for all models like this:
group1
group2
group3
...
What I need is that for 3 models it shows like that (above), but for other one it have to show like this (tree structure):
group1
      group1_0
      group1_1
group2
group3
      group3_0
...
Can anyone help me with this? Can anyone point me to some implementation of this or (what else I found is) should I depending on value from JComboBox 'switch' between JList and JTree? And how would I do that without messing with layout (I am using GridBagLayout).