Hi Guys,
I have a problem with loading large datas into my comboBox and would appreciate it if you guys,could tell me if it could be done with the glazed list.
The scenario is as follows:
I have a JCombobox which must be filled in with a large number of Data(May be millions of elements).
My program is developed as an applet following the client-server architecture.In the program, we have a limitation that only 1Gb of memory is allocated for our program.So we can load only 1Gb of data into memory,the remaining is stored in the hard drive. So if our data, to be loaded into the comboBox is more than 1Gb, only parts of the data could be loaded into the comboBox.
So my idea is as follows and I would like to know from you guys wheather it could be done with the glazed list.
The data to load into the combobox is got from the server.
So I have decided to implement the "Value List Handler" pattern which gives always a sublist of the whole list of data.
Following is a link of the "value list handler" pattern link.
http://java.sun.com/blueprints/core...istHandler.html.
It has methods for getting a sublist from the whole list.
So my real problem or what I need is as follows:
The JComboBox on loading will be initially populated ,with the values it gets from the "valueListIterator"(a subList with a limit of 1 Gb).But the scrollbar should look in a way that the combobox is filled with the whole data.
When the user scrolls down or moves up the other sublists are got from the server(Using the Iterator) & the combobox must have to be filled in with this sublist.
So In short the combobox gets its values in pieces while scrolling up & down the list either using the scroll bar or using the up,down arrow keys.
For the end user, the behaviour of the combobox is as if the whole list of data is loaded into the comboBox.
Another thing is,When should be the new sublists loaded into the comboBox ,I mean which is the scrollBar level, when the newsublists should be loaded..
Any help or tips in this direction is appreciated....
Thanks