Hi everyone,I have two Java classes. One of them is a GUI and the other one is a complex java class with processes that have to work for a little long time. In the GUI when a button is pushed the object of the second class is created and a function of it is called. In this function the program gets stuck in the line "wait();". How can I get rid of this problem? I hope i could express my problem clearly. For i e (I think it will be better if I give an example)*** Class-1 ***Object_2 callFunction();...*********************Class-2 ****void callFunction(){. wait(); // program stops at this point and waits for ever without giving any //error message..}
The code is like below.** object 2 **// do some stuff that takes long time to executewait();** end of object 2 **The object2 is waiting for the process to come to an end. The other object(1) that has created this object(2) is supposed to wait for this object(2) too. But it(1) doesn't wait. That is the problem.. Do you recommend me to use notify() instead ??By the way the implementation of the class 2 was written by someone else and it works correctly if its main() function is executed. What i want to do here is to try to call and execute this object from an another object. Edited by: ccelgun on Nov 11. 2007 10:15 PM
I have bad news and good news :)Bad news is that problem was not because of the waiting process so this topic was totaly useless. Good news is that i found the problem and fixed it. It was because of the path in which the object 2 was working. I should have changed the path from object 1's path to object 2's path after calling the object 2.. Thanks anyway... And sorry for disturbing..
Forex Groups - Tips on Trading
Related article:
http://forum.java.sun.com/thread.jspa?threadID=5234970
comments | Add comment | Report as Spam
|