I am using JComboBoxes to hold my origin and destination airport values and they are initialised at the start to display ANY.
What I've noticed though is that after a search has been done with different criteria than ANY, when I pull down the box to set the value for another search the items do not appear in the list in any particular order which means my ANY option could be anywhere instead of the very first option in the list where I would like it to be.
Has anyone any idea how to achieve this. I am using an extended DefaultComboBoxModel.
Much appreciated Sam
Originally posted by Samantha O'Neill:
Thanks for the reply but I already have my items in a combo box that's not really the porblem. I just wanted to know if there was a way I could always get my 'ANY' option to always be the first item in the list?
Many thanks Sam
I meant by using a SortedSet you'd have them alphabetically sorted.
Oh yes, Any isn't neccessarily first, still that shouldn't be a problem, I add my All BLABLABLA just before adding the rest, and its always on top, then again maybe thats because I dont have any other records starting with A, and I dont use the SortedSet except on startup, I doubt thats a problem tho, give it a shot