How to programmatically fire a MouseEvent to a MouseListener with Java?

You could create your own MouseEvent and loop through all the listeners and make the call.

You could create your own MouseEvent and loop through all the listeners and make the call. For example: MouseEvent me = new MouseEvent(tree, 0, 0, 0, 100, 100, 1, false); for(MouseListener ml: tree. GetMouseListeners()){ ml.

MousePressed(me); }.

1 - IMO this approach is preferable to emulation of native system events. – Mike Kwan Jul 27 at 11:08.

The Robot class might be what you're looking for. This class is used to generate native system input events for the purposes of test automation, self-running demos, and other applications where control of the mouse and keyboard is needed. The primary purpose of Robot is to facilitate automated testing of Java platform implementations.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions