views:

241

answers:

2

I have a java method activated by a mouse click on a button

 private void backButtonMouseClicked(java.awt.event.MouseEvent evt) { do stuff }

is there some way to virtually use this method from another method without clicking the mouse on the button?

A: 

Yes, MouseEvent has public constructors, so you simply create one, and call the function with it.

Zed
A: 

Or you can just use button.doClick();

camickr
I can see the button being clicked programatically but the function it is supposed to perform does not happen. When I click it with the mouse it does function? what am I missing?
kokokok
Don't know. You must not have the proper reference to the button.
camickr