Re: XMPP Java bot loop question
- From: Roedy Green <see_website@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 31 Jul 2007 13:43:14 GMT
On Tue, 31 Jul 2007 12:58:27 +0100, Sabine Dinis Blochberger
<no.spam@xxxxxxxxxxxx> wrote, quoted or indirectly quoted someone who
said :
How would I wait for those events and have the application keep
executing? I am a bit clueless aobut threads in Java, but I have used
them in Delphi...
If the system sends you events when things happen, there is no need
for you to do anything while you wait. When you get an event, deal
with it quickly, or you must spawn a thread to deal with it over an
extended period of time. Until you return from the event handler, the
GUI will be unresponsive.
If you need to periodically wake up and sniff around doing something
then go back to sleep, use a Timer see
http://mindprod.com/jgloss/timer.html or a sleeping background Thread.
See http://mindprod.com/jgloss/thread.html
It is unlikely you need to continuously compute something in the
background, so it unlikely you will need threads.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
.
- References:
- XMPP Java bot loop question
- From: Sabine Dinis Blochberger
- XMPP Java bot loop question
- Prev by Date: Re: non blocking write on TCP/IP channel
- Next by Date: Newbie on JtextArea swing component
- Previous by thread: XMPP Java bot loop question
- Next by thread: Newbie on JtextArea swing component
- Index(es):