Results 1 to 5 of 5
  1. #1
    rameshraj is offline Member
    Join Date
    Dec 2007
    Posts
    42
    Rep Power
    0

    Thumbs up 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.

  2. #2
    Johnny Kewl is offline Member
    Join Date
    May 2008
    Location
    SA
    Posts
    4
    Rep Power
    0

    Default

    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

  3. #3
    rameshraj is offline Member
    Join Date
    Dec 2007
    Posts
    42
    Rep Power
    0

    Thumbs up

    Thank you the problem now seems to be solved.

  4. #4
    Wishes is offline Member
    Join Date
    Nov 2010
    Posts
    20
    Rep Power
    0

    Default

    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

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by Wishes View Post
    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

  1. Threads!
    By rameshraj in forum Advanced Java
    Replies: 1
    Last Post: 05-04-2008, 05:11 PM
  2. Using threads
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-11-2007, 11:25 AM
  3. Threads
    By one198 in forum Threads and Synchronization
    Replies: 1
    Last Post: 11-20-2007, 07:15 PM
  4. Using threads as a countdowntimer
    By lacoste in forum Threads and Synchronization
    Replies: 4
    Last Post: 07-20-2007, 02:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •