java.awt.Robot allows Java programs to simulate mouse clicks and keypresses, but doesn't help in finding where windows are or if they're minimized etc., unless you're willing to do image recognition on screen captures.
windowlib aims to provide these missing features.
ant fetch; ant jar
GPLv3+.