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)”.
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:
[code]private void btnCancelarActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose();
Principal pr = new Principal();
pr.setEnabled(true);
[/code]
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!