Ok i'm quite new to Java so i'll try to explain my problem as well as I can
I have a Producer thread and a Consumer thread.. Both of them are started using .start() in the main method.
On the other hand I have a GUI which has two buttons. One of them must be used to increment the shared variable and the other one to decrement it.
I'm looking for a way to make these threads execute when pressing the corresponding button. I tried making them wait() just when they enter the run() method but then when I notify() them (this is done in another class) i get the IllegalMonitor blah blah exception..
Is there any other wise way to do what i'm trying to achieve? The only thing is that it MUST be done with threads.
Anyone remember their first steps in threading?