create your MouseEvent and then dispath it whenever & wherever you want, and you can catch it and do something you like if you override a window's processMouseEvent method.