I am writing an application that calls a function which brings up a JFrame window. I want the calling thread to block until user input has been entered into the JFrame window. How do I accomplish this?
Instead of using a JFrame, see if it's possible to accomplish getting the text from the user by displaying a JDialog instead. If so, you can block the caller while the JDialog is showing by having previously called JDialog.setModal(true) before the JDialog displays. This should effectively block the caller until the JDialog is disposed. If this does'nt work, then from the caller's code, create a synchronized block that waits on the JFrame that is displayed. After the text is entered, notify the caller using notify() to continue processing. SAF