Here:
CustomerMainScreenLogin cmsl = new CustomerMainScreenLogin(); // A new instance? Why?
cmsl.jMenu1.setEnabled(true); //Here jMenu1 references the new instance menu 1, not the current one's.
this.dispose();
Why do you create a new instance of CustomerMainScreenLogin
class? Most likely jMenu1
is enabled but in a new non visible CustomerMainScreenLogin
object. To make it visible just call cms1.setVisible(true)
and you'll see that.
So you need to reference the current instance of CustomerMainScreenLogin
class instead of creating a new one. For instance by making jMenu1
static and calling jMenu1.setEnabled(true)
in this way:
CustomerMainScreenLogin.jMenu1.setEnabled(true);
this.dispose();