• Post Reply Bookmark Topic Watch Topic
  • New Topic

JFrame Memory Leak

 
Anand Agarwal
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am writing a simple application where i create an instance of JFrame and after that i call dispose method of JFrame and set the reference to null. Though by calling dispose all the resources attached with frame are released but ref to jframe is not released. I want to exit from JVM after dispose is called and frame is set null without calling System.exit(0).
Does anybody no the solution or have tried this . If yes let me know the soltion.
Thanks
Anand
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only way to exit the JVM is System.exit()...

I'm not really clear on what you are trying to achieve...
 
Chad McGowan
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I'm reading your question right- this is what you need:
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
where 'this' is your JFrame
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!