In the snippet below ParentClass starts Controller then hides.
It would be nice to be able to kill ParentClass on jMenuItemExitActionPerformed.
In retrospect I should have reversed the Parent/Child relationship, but that would be a big change at this point.
Is there a simpler way?
public class ParentClass extends javax.swing.JFrame {
private void processC() {
JFrame controller = new Controller();
this.setVisible(false);
...
public class Controller extends javax.swing.JFrame {
private void jMenuItemExitActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
...
The easiest way would be to pass a reference to the parent, like so: