I want to create one Jframe from another class (main class) and then I want to display Jframe only if no error in main method. Otherwise I want to create & display dialog by passing that same jframe. I forgot thread concept anywhere give me the solution, I tried below code, that prints "abcde" but not display the frame program complete.I want to create one Jframe from another class