Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #4718
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Newsgroups | comp.lang.java.gui |
| Subject | Re: pls hlep, can't get output |
| Date | 2011-10-30 20:17 -0700 |
| Organization | Canadian Mind Products |
| Message-ID | <cq3sa7t04bs2h27eue17f7l9vh39elochb@4ax.com> (permalink) |
| References | <33f44292-1f4f-4084-acee-259e633dbb59@x16g2000prd.googlegroups.com> |
On Mon, 17 Oct 2011 21:07:09 -0700 (PDT), kk <kcool.99x@gmail.com>
wrote, quoted or indirectly quoted someone who said :
>while(true){
>
>
>
> g.drawLine(startX,startY,endX,endY);
> newpoint();
> //
>this.repaint(startX,startY,endX,endY);
> try{
> Thread.sleep(1000);
> }catch(Exception e){}
This locks up the EDT thread, effectively freezing the app. Nothing
can get done. each paint should do one frame and exit. Use a Timer to
trigger periodic repaints.
see http://mindprod.com/jgloss/timer.html
see http://mindprod.com/jgloss/sleep.html
see http://mindprod.com/jgloss/edt.html
Other thoughts:
see http://mindprod.com/jgloss/namingconventions.html
If you want to see something happen, you must draw something different
each paint.
There are probably lots of little animation Applets with source code
out there on the web you can study
The closest thing I have on my website is
http://mindprod.com/webstart/setclock.html
that keeps a text display of the time current. You can do better than
that.
--
Roedy Green Canadian Mind Products
http://mindprod.com
It's difficult to be rigorous about whether a machine really knows,
thinks, etc., because we’re hard put to define these things.
We understand human mental processes only slightly better than
a fish understands swimming.
~ John McCarthy (born: 1927-09-04 died: 2011-10-23 at age: 84).
Inventor of the term AI (Artificial Intelligence),
the short-circuit OR operator (|| in Java),
and LISP (LIst Processing Language) that makes EMACS
(Extensible MACro System) so addictive.
Back to comp.lang.java.gui | Previous | Next — Previous in thread | Next in thread | Find similar
pls hlep, can't get output kk <kcool.99x@gmail.com> - 2011-10-17 21:07 -0700 Re: pls hlep, can't get output Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2011-10-18 09:25 -0700 Re: pls hlep, can't get output Roedy Green <see_website@mindprod.com.invalid> - 2011-10-30 20:17 -0700 Re: pls hlep, can't get output Knute Johnson <nospam@knutejohnson.com> - 2011-10-30 20:28 -0700 Re: pls hlep, can't get output Roedy Green <see_website@mindprod.com.invalid> - 2011-10-30 22:21 -0700
csiph-web