Try FEST . This simplifies the functional testing process of the Swing GUI by allowing you to access the Swing components by name and then interact with them.
Example from the FEST website:
dialog.comboBox("domain").select("Users"); dialog.textBox("username").enterText("alex.ruiz"); dialog.button("ok").click(); dialog.optionPane().requireErrorMessage() .requireMessage("Please enter your password");
Edit:
Alternatively, what you are trying to achieve should be very simple using Math.random (), a loop, findBomponentAt (int, int) and the Robot class. The Robot class mitght class is especially useful because it has methods for replacing mouse and keyboard events.
source share