[quote=“API-mehtod dipose() from java.awt.Window”]Releases all of the native screen resources used by this Window, its subcomponents, and all of its owned children. That is, the resources for these Components will be destroyed, any memory they consume will be returned to the OS, and they will be marked as undisplayable.
The Window and its subcomponents can be made displayable again by rebuilding the native resources with a subsequent call to pack or show. The states of the recreated Window and its subcomponents will be identical to the states of these objects at the point where the Window was disposed (not accounting for additional modifications between those actions).
Note: When the last displayable window within the Java virtual machine (VM) is disposed of, the VM may terminate. See AWT Threading Issues for more information. [/quote]
Logo, vc não perde o objeto, ele apenas esta escondido, mas a variavel ainda está referenciando ele. Para “limpar” o resto dele, ai sim vc deveria tirar todas as referencias dessa janela de qualquer variavel, setando pra nulo.
A minhaJanela é uma “filha”, ou seja, não é a principal do sistema.
Se eu utilizar seu EXIT_ON_CLOSE quando a fecho fecho o sistema todo. Naum posso fazer isso.
Continuo na dúvida… [/quote]
estou com um problema parecido…
tenho uma tela1 que tem um botao que chama a tela2…
preciso que quando a tela2 fosse fechada… ela fechasse msm, como se nunca tivesse sido aberta…
se eu utilizo o EXIT_ON_CLOSE ele fecha o sistema inteiro…