[2400] in java-interest

home help back first fref pref prev next nref lref last post

Re: What am I doing Wrong?

daemon@ATHENA.MIT.EDU (Arthur van Hoff)
Sat Sep 30 09:11:48 1995

Date: Fri, 29 Sep 1995 09:08:23 -0700
From: Arthur.Vanhoff@Eng.Sun.COM (Arthur van Hoff)
To: jones@iwn.com
Cc: java-interest@java.Eng.Sun.COM


Hi Joe,

> 	I'm writting a small applet that needs to talk to a server once very n =
> seconds.The way I envisioned the code working is something like this:
> 
> 	public void run() {
> 		make connection to server
> 		request data
> 		close connection to server
> 		process request
> 		repaint()
> 		sleep thread n seconds
> 	}
> 
> Unfortunately this only happens once. What is wrong. (Even if I take out =
> the sleep thread part, it still only executes the run method once.)

The run method is called once. When it returns the thread is done.
If you want to do more than one thing you simply have to put a loop
in the run method.

Have fun,

	Arthur van Hoff
	
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post