Re: Coordinating multiple JTextField updates across panels
John B. Matthews wrote:
In article <4a36e448$0$30328$b9f67a60@news.newsdemon.com>,
Knute Johnson <nospam@rabbitbrush.frazmtn.com> wrote:
John B. Matthews wrote:
In article
<4a366bb8$0$32356$5a62ac22@per-qv1-newsreader-01.iinet.net.au>,
"Jarrick Chagma" <jarrick@large.com> wrote:
[...]
Do you realise that there are many, many panels and that
this is the cause of the problem?
How many is "many, many"? I see apparently simultaneous updates
with 256 separate JPanels. I really don't think that's the problem.
Perhaps you could supply a short example:
<http://pscode.org/sscce.html>.
Here's an SSCCE with a thousand JTextFields being updated. I see his
problem on my computer. A really fast computer might not.
I see your point, but a thousand fields on my oldest 1 GHz machine
causes barely a ripple; that's 20 times the 50 text fields mentioned by
the OP. Your glass pane example and Michael Rauscher's use of
RepaintManager are exemplary, but I fear the OP may have systemic
problems, too. In particular, he may have errant processes interrupting
his application, as suggested by Mark Space.
I would also advocate carefully separating the view and the model, as
suggested in the example below. The single notification allows the
numerous update events to coalesce. If the model's update method takes
unacceptably long, it can be delegated to a SwingWorker.
John:
It's probably the computer/graphics card combo because I still see it to
some extent on your example as well. As I said before, it doesn't
bother me all that much and I was only trying to give the OP a
workaround. I don't really know how the drawing coalesces in a
situation like this but I would imagine if the setText() calls took long
enough, it wouldn't coalesce all of the drawing into one call. As to
other processes, that's always a possibility. Windows machines are
often up to strange doings, anti-virus software being a regular culprit.
--
Knute Johnson
email s/nospam/knute2009/
--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access