Reputation: 479
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?
Upvotes: 1
Views: 2370
Reputation: 833
I believe you can say backButtonMouseClicked(new MouseEvent()) to call the method. Or maybe backButtonMouseClicked(null).
Upvotes: 0
Reputation: 57648
Yes, MouseEvent has public constructors, so you simply create one, and call the function with it.
Upvotes: 0