I have the following situation. There is a class JFrame1 that executes a serie of instructions and gives focus to another JFrame2 and then resumes. When JFrame2 has got focus, JFrame1 should expect that JFrame2 disposes rather than perform the following instructions. What to do?
JFrame1{
//instruction 1
//instruction 2
// ....
//instruction 6
JFrame2 starts
[waiting for results of JFrame2]
//instruction 7
//instruction 8}
JFrame1 should execute instructions 7 and 8 when resumes focus
Normally it is not good to have a JFrame start another JFrame unless they are completely independent. I reccomend that you launch a JDialog instead of JFrame2. A JDialog is used the same way as a JFrame and all the commands are the same. The JFrame that launches the JDialog will pause until the JDialog is disposed with this.dispose() being called from within the JDialog class. Then it would look like this: