This content has been marked as final. Show 5 replies
Don't use a JComboBox. Use a JTable with a customized model instead.
UPDATE: you can supply your own model to a JComboBox too.
Edited by: marcos_aps on 25/05/2012 11:26
Hi can u explain little bit more on how i can use jtable for my requirement. I am not able to figure out how i can use jtable for my requirement.
Well, you will have to configure your table to look like a JList, so no header and no grid lines. Of course it won't have a button to select items like a combo box, but the data will be fetched lazily as you want if you provide a custom table model. Regarding custom table models, you can look here:
Ay suggestions? kindly help me in this.
I do not think users would normally prefer to scroll through thousands or more items in a combo box to pick their choice. You may want to redesign your GUI somewhat like splitting the data into categories and use two combos, one for categories and one for the data and populate the data one based on the value selected on the category one. In case splitting like this is not possible then you may consider to apply some filtering in your JComboBox/JTable so that users can select their choice as they type. I guess this may be of some help to you