I have a page with constuctor.
So, I have a button, and when this button is clicked, then function handleLogin starts to work.
I have a page with constuctor.
So, I have a button, and when this button is clicked, then function handleLogin starts to work.
You can't do what you want in the constructor. Your
handleLogin()
method callsthis.getWindow()
, but your the button doesn't have a window until after it (and its parents) have been added to some frame that has been made visible. You have to callhandleLogin()
after the GUI has been fully created and made visible.