java - Enabling a jbutton at startup -


i have login form , mainform. in mainform have disabled jbutton. want enable jbutton if username login form "admin". have singleton controller instantiated in both forms.

if(controller.admin=="admin"){jbutton.setenabled(true)}; 

but i’m new swing , don't know use code. tried using in mainform's constructor didn't work.

   if((controller.admin).equals("admin"))   {  jbutton.setenabled(true);   } 

this correct code .please describe questions code


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -