2 Replies Latest reply on Jan 17, 2007 7:11 AM by Jim Knopf

    Thread.wait() in an Action

    Jim Knopf Newbie

      Hi all,

      i want to wait (this.wait()) in an action if there is no Data from my Database and notify this Thread after the database is filled with this data.

      Example:

      myAction{
       while( noDataInDB() ){
       this.wait();
       }
      }
      


      The Problem is, if i do this and call token.signal(); the whole Programme freez.

      signal Example:
      onButtonAction( ... ){
       System.err.println("befor Signal");
       getSelectedNode().getToken().signal();
       System.err.println("after Signal");
      }
      

      This print only "befor Signal" and after that it will freez.
      So the signal won't return and my UI-Applikation will stop :( .

      Could some one help me? Is there no way to make a wait in an action?