You can solve the problem by using some sort of waiting method for the SecondWindow. When the MainWindow opens the SecondWindow, it also calls the waiting method of the SecondWindow. The waiting...