I am new to Swings Programming.Iwant to display the contents of JList in the below specified way :
Want to segregate the contents of JList based on Respective catagories.
I have other three Jlists which contains Cities , States and Games separately.
Can any one suggest me any idea of how to do it.
Thanks in Advance.
Hareendranath Babu Kotha
Joined: May 22, 2006
Hi All ,
In continuation to my previous post , please see the screen shot to know the way i want to display.
Hareendranath Babu Kotha wrote:i'm storing them in 3 different JLists only. But while displaying i have to display them in above mentioned manner.
can any one suggest me how to display the lists in specified manner.
I guess I don't understand how it makes any sense to display them in the above-mentioned manner if you're storing them in 3 different JLists. If you explain this it helps us help you, because it's hard for us to suggest things that don't seem to make any sense.
That said, you should be able to make it look any way you want. What part are you having trouble with?
You should be able to make each list element look any way you want by setting a custom ListCellRenderer. You may also want to set a custom ListSelectionModel to prevent the list elements that serve as category headers from being selected.
As i said i'm having separate lists , i kept the code which i wrote. even though i'm having separate lists for separate categories i'm seeting them in only model called activeFiltersListModel , with right transfer button i'm adding the selected values from availableFiltersList to activeFiltersList and respective models of lists will be updated.
As i said i want to display the selected values in ActiveFilters Section with the way i specified.