Galera, é o seguinte: Eu tenho um JFrame Principal e alguns Menus que chamam outros JFrames. Ao abrir um novo JFrame eu gostaria que o principal ficasse "inativo" - enable(false) - e quando o JFrame que abriu em cima do Principal fosse fechado o Principal ficaria "enable(true)".
[img]http://lh6.ggpht.com/_mgHkRN4JtR8/TPQ9ak9zeXI/AAAAAAAAB5w/WAUJ8T2E5FU/s720/print.JPG[/img]
Eu fiz o seguinte no JFrame Principal:
private void MenuItemCadLeitoresActionPerformed(java.awt.event.ActionEvent evt) {
new CadastroLeitores().setVisible(true);
this.setEnabled(false);
E no JFrame CadastroLeitores:
private void btnCancelarActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose();
Principal pr = new Principal();
pr.setEnabled(true);
Mas quando o JFrame que abriu em cima do Principal (no caso o CadastroLeitores) é fechado o Principal continua "enable(false)".
Se alguem puder ajudar eu ficaria grato! Valeu!