I have two classes:
public class Screen1 extends javax.swing.JFrame {
...
//disables JButton1 after it is clicked on
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt){
setVisible(false);
....
}
}
And another class:
public class Screen2 extends javax.swing.JFrame {
...
//Clicking on JButton2 is supposed to enable JButton1 (from Screen1) again
...
}
Now, what is the easiest way to enable JButton1 again? I don't have direct access to JButton1 from Screen1 to set is visible again. I've looked into ActionListeners and Modal JDialogs which seemed from my Google search like some promising ways to solve this (possibly?). But I can't really find an example that I would understand (I'm more of a Java beginner).
Any helpful input is appreciated!