0

I am calling dispose method and also setting setDefaultCloseOperation for the frame.

However, after dispose being called upon, i checked with Dialog.getallwindows() the frame is not actually killed. Is there any alternative way to dispose frame

joe
  • 77
  • 2
  • 9
  • why would you want to do it? any gain by doing so? https://stackoverflow.com/questions/1234912/how-to-programmatically-close-a-jframe – XtremeBaumer Jul 06 '17 at 08:46
  • i have a feeling my desktop client is getting slow with number of increasing frames. Also i i iterate over Dialog.getallwindows it takes more time – joe Jul 06 '17 at 09:09
  • how many frames are you talking of? normally it is enough to dispose any frame as the GC will clear it up afterwards. if you want to force the GC to run, call `System.gc();` – XtremeBaumer Jul 06 '17 at 09:18
  • 1000 frames are running smoothly and at 10k its starting to lag a bit. yet no gui should ever extend way more than 10-20 frames at a time and this should not be a problem unless you work on a toaster – XtremeBaumer Jul 06 '17 at 09:26
  • But if i am iterating over dialog.getwindows before creating a new frame it takes time – joe Jul 06 '17 at 10:13
  • Please edit your question to include a [mcve] that exhibits the problem you describe. – trashgod Jul 06 '17 at 10:20

0 Answers0