CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2000
    Location
    Canada
    Posts
    27

    Thread Situation

    I'm using the JDK 1.0.2 to create applets that all browsers can run. What I need to do is open a dialog box and have the current thread wait until the dialog box closes. The dialog box requires input before it closes.

    My real problem is that the current thread happens to be the AWT event handler thread. So if I try any wait()ing or notify()ing or suspend()ing, then it will lock up the thread and there will be no way of receiving any input.

    Simply put, how can I do this without affecting the AWT thread?

    Thanks.


  2. #2
    Join Date
    Nov 1999
    Location
    Indianapolis, IN
    Posts
    191

    Re: Thread Situation

    You need to implement a "Worker" thread. See this tutorial

    http://web2.java.sun.com/docs/books/...c/threads.html

    It's more about the newer versions of Swing, but the concept will be the same for you.

    Basically, you need a separate thread to control your application. This will free up the AWT thread to continue painting and handling input.

    Good luck!


  3. #3
    Join Date
    Apr 2000
    Location
    Canada
    Posts
    27

    Re: Thread Situation

    Thank you very much!


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured