I am calling main() method of one class into other class like :
My parent class is a java frame and i have a button in it. While clicking on this button i am calling main() as given above. Its calling main() successfully and opening up a new child frame of Playshow class. But when i close this child window my parent window is also closing. Its exiting from the application. I am not getting why its closing the whole application. Please if anybody has any idea help me. Thanks and Regards,
What are doing for setDefaultCloseOperation(int) on your window? If it's EXIT_ON_CLOSE, then that explains it - closing the window will terminate the JVM. You should set it to HIDE_ON_CLOSE (or DISPOSE_ON_CLOSE if you know what you're doing).
Charles Lyons (SCJP 1.4, April 2003; SCJP 5, Dec 2006; SCWCD 1.4b, April 2004)
Author of OCEJWCD Study Companion for Oracle Exam 1Z0-899 (ISBN 0955160340 / AmazonAmazon UK )