[Java-gnome-developer] Multithreaded apps (was: Re: broken link)
Brought to you by:
afcowie
From: Joao V. <jvi...@ya...> - 2005-01-11 02:21:21
|
Err... sorry but i didn't understand the problem very well yet. BTW, there's a doc about it here: http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html I've read parts of it, but still didn't understand (maybe i'm too sleepy...). I think the reason why i didn't understand is because i've used threads many times on Swing apps, and i've never used invokeLater. Let me picture a simple example so we can work on it: Suppose you're making a chat client, where you have a List widget showing the online users. Suppose you have a thread which is listening for new packets. Everytime this thread receives a "New user" msg packet, it adds a new user to the List widget, and calls repaint (i think it's not necessary to call repaint on this situation, but whatever). So in this example there's no use of invokeLater, even though the widget is being updated by a thread. Would this somehow "break" something? I mean... i think i've done that sometimes, never seen any problem :P Cheers, J.V. _______________________________________________________ Yahoo! Acesso Grátis - Instale o discador do Yahoo! agora. http://br.acesso.yahoo.com/ - Internet rápida e grátis |