I have a login form and a mainform.
In the mainform I have a disabled JButton
.
I want to enable that JButton
only if the username that I get from the login form is "admin".
I have a singleton controller instantiated in both forms.
I do something like
if(controller.admin=="admin"){jbutton.setEnabled(true)};
but I’m new to swing and I don't know where to use this code. I tried using it in the mainform's constructor but it didn't work.
this is the correct code .please describe the questions with code