I am developing a multi-threaded program. The thing is that I have a GUIThread and a XMLsettingsReaderThread (well among other threads).... Now it is absolutely necessary that the GUIThread is executed and completed to a certain level before the XMLsettingsReaderThread starts...Now how do I do this? The problem is that I want the GUIthread create a Frame first before XMLsettingsReaderThread starts cause it uses a getter on the Frame(created in GUIThread) and if XMLsettingsReaderThread is first then there is no frame yet so I get NullPointerException.
That's what the Object.wait() and Object.notify() methods are for, in conjunction with the synchronized keyword or block.
I recommend you read the threading (concurrency) tutorial.