Help with wait statement
Basically I have my main GUI Window opening a secondary form window and then waiting. It will stop waiting when the user submits form data through the secondary window and clicks submit (this calls notify on the main GUI).
The problem is that the secondary window is not displaying; when I call wait right after creating it the whole GUI locks up while waiting to be notified (which won't happen because the secondary window is not loading first). It loads fine if I take out the wait statement right after, but I need it there to acheive the desired functionality. Here is the relevant code.
java.awt.EventQueue.invokeLater(new Runnable(){
publicvoid run(){
new ClassChooserWindow(g, lm, cm);
}
});
synchronized (this){
try{
wait();
}catch(Exception e){
e.printStackTrace();
}
}
I appreciate any ideas you can give me.

