|
Author |
Topic: structure of void loop(); (Read 2373 times) |
|
minh
|
structure of void loop();
« on: Mar 27th, 2005, 1:12am » |
|
is void loop() a Thread? and is Thread or Runnable implicitly extended to BApplet? (so i don't have to extend Thread or Runnable, it's one of those ) curious.
|
|
|
|
fry
|
Re: structure of void loop();
« Reply #1 on: Mar 27th, 2005, 6:54am » |
|
yeah, loop() is running on a thread. the idea of having loop() is so to avoid people having to learn how to write a thread before they can animate anything.
|
|
|
|
minh
|
Re: structure of void loop();
« Reply #2 on: Mar 27th, 2005, 11:06pm » |
|
and also, so the loop() function is inside a paint() or paintComponent() right? thanks
|
|
|
|
fry
|
Re: structure of void loop();
« Reply #3 on: Mar 28th, 2005, 1:10am » |
|
on Mar 27th, 2005, 11:06pm, minh wrote:and also, so the loop() function is inside a paint() or paintComponent() right |
| functionally yes, but technically no. paintComponent() is called on the awt thread, loop() is called on the thread we were just discussing. so loop() takes care of handling the drawing, and then asks for a repaint. the awt thread then gets around to calling paint/paintComponent, at which time a single Image for the entire applet area is drawn to the screen.
|
|
|
|
|