File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JFrame

 
Rus Corina
Ranch Hand
Posts: 90
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have an application that consists of a main frame, and then when i press a button another frame opens. Now, I have a problem. When i close the second frame that's opened from the first one, it causes both frames to close. Do you have any idea how to avoid that? I mean, when i close the second frame, i want to close just it, not the main one as well.
 
Rob Spoor
Sheriff
Pie
Posts: 20398
47
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't use EXIT_ON_CLOSE as the default close operation but DISPOSE_ON_CLOSE instead. EXIT_ON_CLOSE causes System.exit to be closed, which will terminate the entire JVM. DISPOSE_ON_CLOSE only disposes (closes) the frame itself.
 
Rus Corina
Ranch Hand
Posts: 90
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much.It worked
 
Rob Spoor
Sheriff
Pie
Posts: 20398
47
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
Sultan Ali
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the Dispose function for that frame only when you click the button call this dispose in your actionperformed
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic