T
testing1234567891011
I'm writing a swing application that needs to repaint() different
rectangular areas on a JPanel inside a loop. I've noticed, however,
that when a call to repaint() is in a loop, only the last call to
repaint() (in the last iteration) is actually called. Being that the
other threads responsible for calling paint() or update() on the
component somehow fall through, I tried putting a Thread.sleep(x)
before repainting. With this arrangement, only some of the repaint()s
work, but rarely all of them. What do I do to get repaint() to work
reliably inside of a loop?
Thanks in advance,
Rob
rectangular areas on a JPanel inside a loop. I've noticed, however,
that when a call to repaint() is in a loop, only the last call to
repaint() (in the last iteration) is actually called. Being that the
other threads responsible for calling paint() or update() on the
component somehow fall through, I tried putting a Thread.sleep(x)
before repainting. With this arrangement, only some of the repaint()s
work, but rarely all of them. What do I do to get repaint() to work
reliably inside of a loop?
Thanks in advance,
Rob