Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.help > #2340
| Newsgroups | comp.lang.java.help |
|---|---|
| Date | 2012-12-06 11:10 -0800 |
| References | <118db2e0-86dc-4d6b-aabb-ba68ee8c2f53@googlegroups.com> <aic2rrF431U1@mid.individual.net> |
| Message-ID | <848c30ed-2727-429e-a1ba-d85133a755ff@googlegroups.com> (permalink) |
| Subject | Re: Need simple example of how to safely pass data from worker to EDT swing threads. |
| From | Lew <lewbloch@gmail.com> |
Nigel Wade wrote: > Although this may not solve the problem you were previously having, > which is most likely caused by having too many objects in the JComboBox. > You will still have the same number of objects in the JComboBox when > SwingWorker.done() is completed. > > When you open the JComboBox the EDT has to render all 3000 objects into > the popup list. Unless one needs all 3000 or 5000 entries on screen at the same time, it might not be necessary to fetch them all into the GUI widget at once. There is a technique called "windowing" or "cursoring" (to verb some nouns). For such a small number of items via I/O as yours, you can pull them into an abstract model that feeds the GUI model, say a map or list or other collection. When the screen needs a view into that abstract model, let's say items k through k+99 inclusive, you feed those items into the GUI model along with some housekeeping variables to locate where the window is within the complete data structure. (Via the techniques others have already described to keep GUI on the EDT and non-GUI off the EDT.) So the GUI only knows about a manageable number of entries at any one time. This will work if copying small amounts of data into the GUI model is faster than displaying large amounts at once in the GUI model. -- Lew
Back to comp.lang.java.help | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Need simple example of how to safely pass data from worker to EDT swing threads. kwiateks@gmail.com - 2012-12-06 07:07 -0800
Re: Need simple example of how to safely pass data from worker to EDT swing threads. Eric Sosman <esosman@comcast-dot-net.invalid> - 2012-12-06 10:29 -0500
Re: Need simple example of how to safely pass data from worker to EDT swing threads. kedward777@gmail.com - 2012-12-06 09:09 -0800
Re: Need simple example of how to safely pass data from worker to EDT swing threads. Nigel Wade <nmw@ion.le.ac.uk> - 2012-12-06 17:27 +0000
Re: Need simple example of how to safely pass data from worker to EDT swing threads. Lew <lewbloch@gmail.com> - 2012-12-06 11:10 -0800
Re: Need simple example of how to safely pass data from worker to EDT swing threads. Roedy Green <see_website@mindprod.com.invalid> - 2012-12-06 15:03 -0800
csiph-web