Article View: borland.public.jbuilder.java.language
Article #16617Re: Simulating animation (refresh problem)
From: rhwang
Date: Tue, 02 Feb 1999 00:00
Date: Tue, 02 Feb 1999 00:00
20 lines
1560 bytes
1560 bytes
check out "changing the position of a component" in the "comp.lang.java.gui" group. i just posted a possible solution (if you had the same problem as i did), and it should appear sometime soon. basically, you should subclass whatever object/component you want to "animate" and make it implement the Runnable interface. in the run() method, loop your setLocation calls (or setBounds or whatever), and then call "Thread.currentThread().sleep(howLongMillisecs)". this thread will ensure that the setLocation is complete before it is called again (rather than rely on the thread of the object that made the call. there are some other issues that you should be aware of.. i explain them in my post.. ok, let me know how this goes... roj -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Technical Details
Message-ID:
<795iml$sku$1@nnrp1.dejanews.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<36913A34.40CCCC1E@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: rhwang@usinteractive.com Subject: Re: Simulating animation (refresh problem) Date: 1999/02/02 Message-ID: <795iml$sku$1@nnrp1.dejanews.com> X-Deja-AN: 439556901 References: <36913A34.40CCCC1E@sciatl.com> X-Http-Proxy: 1.1 x12.dejanews.com:80 (Squid/1.1.22) for client 206.124.255.1 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Tue Feb 02 01:00:09 1999 GMT Newsgroups: borland.public.jbuilder.java.language X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)