java invokation of button

60 Views Asked by At

I have a page with constuctor.

So, I have a button, and when this button is clicked, then function handleLogin starts to work.

2

There are 2 best solutions below

0
On

You can't do what you want in the constructor. Your handleLogin() method calls this.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 call handleLogin() after the GUI has been fully created and made visible.

0
On

Try to create a new thread that waits and then call the function. I suppose it fails because of the element is not created, meaby with this it is... hope I help.