0

Do we have a method or way to find out a JDialog instance is already disposed or not.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Prabhath
  • 585
  • 6
  • 20
  • 1
    `isVisible`? `isDisplayable`? – MadProgrammer Sep 10 '15 at 06:16
  • Yes.But some times JDialog call dispose many times.Some dialog call it when closing it.So if we call GC it will call again.Problem is we keep a log of disposed dialogs.It is a text file.Some dialog log more that one.So need to avoid logging if dispose already called. – Prabhath Sep 10 '15 at 06:23
  • It seems to me that this is a form of premature optimization. If you're worried about dialogs, keep a reference to a small number of dialogs and change their content as needed. But I would only worry about it if the app. was throwing an `OutOfMemoryError` and even then, I'd be looking at other areas of the app. first. – Andrew Thompson Sep 10 '15 at 06:27
  • 1
    @Prabhath by default all Top-Level containers are always accesible for current JVM, [for more info see about](http://stackoverflow.com/questions/6309407/remove-top-level-container-on-runtime) – mKorbel Sep 10 '15 at 06:28

0 Answers0