JList
Hi friends
I have a requirement in which the best and simple way to fulfill the functionality ....is to have some way to set a particular element(row) in JList visible false.
This solution will help me to remove coding for adding ,removing and sorting elements of JList .
I went through custom ListCellRenderer example..which have an interface which wont solve the problem.
Does any one know the solution for this and also is it possible to do using ListCellRenderer ?
Thanks
-Sunny Jain-
[532 byte] By [
sunnyjaina] at [2007-11-27 8:16:06]

# 1
Why would hiding a row be simpler than removing it from the model?
Anyway ListCellRenderer is the wrong approach.
If you really want something like this I would suggest wrapping the ListModel inside another model (something like TableSorter) that has visible attribute for each row.
And will return the corrent element for each index depending on the visibility of rows in the model.
# 2
Reason for making visible false is only those elements that are visible true will be displayed and when i add the elements back i can make them visible true.Another Reason i want to use JList is that i allows filtering .as i am new to swing ,i am unable to understand