Results 1 to 5 of 5
Thread: Threads and Swing!
- 05-11-2008, 09:04 AM #1
Member
- Join Date
- Dec 2007
- Posts
- 42
- Rep Power
- 0
Threads and Swing!
I have to work in threads and swing.
I have a class that has some frame components like textarea,textfield and so on.When the button from the frame is clicked, a new working thread is created which reads the input from the InputStream.Now I want to display the read data to the textarea of the frame.How can I do this any idea?I have tried but the message is only printed on the standard output and not displayed on the textarea.
- 05-11-2008, 05:54 PM #2
Member
- Join Date
- May 2008
- Location
- SA
- Posts
- 4
- Rep Power
- 0
Google for SwingWorker, its made for this, and then have a squiz at the source to see how it re-joins the gui thread, if you interested in the details.
Essentially of the thread has done its thing, it asks the gui thread to do the display when its ready... thats the idea
- 05-12-2008, 02:49 PM #3
Member
- Join Date
- Dec 2007
- Posts
- 42
- Rep Power
- 0
Thank you the problem now seems to be solved.
- 12-17-2010, 07:12 PM #4
Member
- Join Date
- Nov 2010
- Posts
- 20
- Rep Power
- 0
hey
I know its old post but this is same problem I have now , anyway I found swing worker difficult to understand is anyway easier to understand for beginner .
thank you
-
Best not to re-activate old threads but rather start your own and link to the old thread if necessary. With SwingWorker as with anything else, it's best to experiment with it a bit with small simple examples to get used to it, and thereby improve your knowledge of how it works. There are lots of examples in this forum that use SwingWorker that you can search for and inspect as well. I'm going to lock this old thread now.
Similar Threads
-
Threads!
By rameshraj in forum Advanced JavaReplies: 1Last Post: 05-04-2008, 04:11 PM -
Using threads
By Java Tip in forum Java TipReplies: 0Last Post: 12-11-2007, 10:25 AM -
Threads
By one198 in forum Threads and SynchronizationReplies: 1Last Post: 11-20-2007, 06:15 PM -
Using threads as a countdowntimer
By lacoste in forum Threads and SynchronizationReplies: 4Last Post: 07-20-2007, 01:06 PM
Bookmarks