Search the web
Sign In
New User? Sign Up
jurtle-users · Jurtle Users
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
GUIDisplay.java   Message List  
Reply | Forward Message #107 of 119 |
Howdy Bill,

For the past few classes, I've been going over GUI interface programming
with my students. I started them off with the slider example
(PolySpiral), but then retreated back to the "GUIDisplay" example as a
better starting point. GUIDisplay uses a named inner class for the
button handling while the PolySpiral uses an anonymous class to handle
the events.

My students started adding their own buttons and then invoking some of
the drawing code from other Jurtle examples in the handler methods. In
every case, the display area did not update until the execution of the
handler completed even though some of the code explicitly asked for
updates to occur as certain intervals. I'm suspicious that there's some
event and/or thread management issue that is not allowing any of the
interim updates, or perhaps the updateDisplay() method is not updating
the drawing container for some other reason.

In the attached file, I took the GUIDisplay example and then inserted
the ColorWheel example's drawing code into the handler for the Blue
Button and as my students experienced, only one display update occurred
at the very end.

What am I not seeing or understanding?

Thanks,

John



Thu Sep 8, 2005 4:43 am

johnkirkilis
Offline Offline
Send Email Send Email

Attachment:
GUIDisplay.java
Type:
text/java
Forward
Message #107 of 119 |
Expand Messages Author Sort by Date

Howdy Bill, For the past few classes, I've been going over GUI interface programming with my students. I started them off with the slider example (PolySpiral),...
John Kirkilis
johnkirkilis
Offline Send Email
Sep 8, 2005
4:39 am

John, This is normal when executing code on the Event Thread. Because the event thread is used for both events and drawing updates, it is somewhat tricky to...
Bill Tschumy
btschumy
Offline Send Email
Sep 8, 2005
1:19 pm

Bill, I was afraid you were going to say that, but since you've provided me with a working example, I'm glad. I've talked about multi-threading to my students...
John Kirkilis
johnkirkilis
Offline Send Email
Sep 9, 2005
12:34 am

... Yes, that's it exactly. If you don't need to see the intermediate drawing there is no need for a separate thread. Once you return from the slider's event...
Bill Tschumy
btschumy
Offline Send Email
Sep 9, 2005
1:19 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help