You could also create a new MouseEvent and post it to the system EventQueue manually.
To simulate a user clicking a mouse button you'd need to post two such events (MOUSE_PRESSED and MOUSE_PRESSED).
The java.awt.Robot class Jesper suggested would probably be a better option, though.
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
The first part of the code is written as a method in a common java file
The second part of the code is written as a call to that common method.
Ispite of these smiley is not drawn ?
Any idea of how to correct it?