The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
February 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

updating on the fly

Posted by Monte on February 28, 2001 at 12:03 PM

If I've understood you correctly, you want a
text box that continually checks the status of
some string or file, and writes that data out
to it's window.

To do this, I would suggest that you make the
text box run in it's own thread. To do this,
create a TextBox class that implements runnable.
in the final line of the constructor write
new Thread(this).start().

Then, in the run() method of the class,
create an infinite while loop (while true)
that continaully reads the String or file,
and writes that data to the textBox window.

If none of this makes sense, look up the
Thread and runnable API's on the Java API
webSite. Hopefully they can help you out.





Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us