How to prevent a combo box from displaying value mutiple times
I have combo box that should display list employee.But currrently it display the defoult value more that one .How do I prevent this ,.The option shoulh be the user who log in into the system.It repeat it in column more then to twice at the beginnig and again at below.thank you
[291 byte] By [
sarasahga] at [2007-10-2 8:41:08]

> I have combo box that should display list employee.But currrently it display the defoult value more that one .How do I prevent this The comboBox will only display the items you add to the comboBox. So the solution is simple, don't add the same item more than once.
I don't know exactly what's going on in your application, so maybe my tip won't be helpful.
What you can do is store the employees in an array, and you can use the Arrays class to binary search through the array (Arrays.binarySearch)
if the employee that you're going to add to the combo box was already added to the combo box, then when you binarysearch the array you will get a value above 0. If it didn't find that value in the array you'll get a negative number
> I don't know exactly what's going on in your> application, so maybe my tip won't be helpful.that's a helpful tip, but you could also define a "combo box model" that was backed by a collection that did now allow duplicates.kind regardswalken