Article View: borland.public.jbuilder.java.language
Article #16807Re: Simulating animation (refresh problem)
From: Tad Frysinger
Date: Wed, 13 Jan 1999 00:00
Date: Wed, 13 Jan 1999 00:00
38 lines
1997 bytes
1997 bytes
In article <36920FC7.2DD0733B@sciatl.com>, tom.heagy@sciatl.com says... > That was a good suggestion however I just tried it and it still doesn't > repaint until the loop is finished. I placed the "repaint()" method call > inside the loop immediately after the call to "setLocation(x,y)". I also > tried the "paintAll" method with similar failure. The problem also seems to > occur with simple TextControls. > > Any other suggestions? Perhaps someone knows of a working example that I > could look at??? > > -Tom > > > > Max Polk wrote: > > > [This followup was posted to borland.public.jbuilder.java.language and a > > copy was sent to the cited author.] > > > > In article <36913A34.40CCCC1E@sciatl.com>, tom.heagy@sciatl.com says... > > > My problem is that the display doesn't refresh until the last move is > > > complete (i.e. I'm out of the loop and control is passed back to the > > > OS). I've played around with "invalidate" and "validate", but with no > > > success. > > > > Have you tried repaint? (in)validate has to do with saying that the > > component needs repainting whenever AWT gets around to it, which can be > > much later. repaint has to do with saying that all pending paint > > commands should occur right away. repaint sounds like what you want. > > > > Get the Geary "Graphic Java" book (Bol I) - has very good explanation of graphics and simple animation. Tad Frysinger [TeamB]
Technical Details
Message-ID:
<MPG.11066f551c2207a698998d@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<36913A34.40CCCC1E@sciatl.com> <MPG.10fb2a0dae6a30af9896a8@forums.borland.com> <36920FC7.2DD0733B@sciatl.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,55c33f6eaaa49fd2 X-Google-Attributes: gidf74b3,public From: tfrysinger@earthlink.net (Tad Frysinger) Subject: Re: Simulating animation (refresh problem) Date: 1999/01/13 Message-ID: <MPG.11066f551c2207a698998d@forums.borland.com> X-Deja-AN: 432158493 References: <36913A34.40CCCC1E@sciatl.com> <MPG.10fb2a0dae6a30af9896a8@forums.borland.com> <36920FC7.2DD0733B@sciatl.com> Organization: Freezone Enterprises Newsgroups: borland.public.jbuilder.java.language