In addition to what Nishant advised, I can add that you can do research and figure out how much you can control you Java application. Use Microsoft Spy++ to spy on message flow of any window. On top of any windowed application there is always a HWND-based windows. Everything inside client area can be anything. Light-weight Java controls are dominant; and they are not based on HWND windows messages, so your chances to use them are not big.
The alternative is using P/Invoke with the Windowd API
SendInput
http://msdn.microsoft.com/en-us/library/ms646310(v=vs.85).aspx[
^]. This API allows for simulation of input events on lower level as if they are triggered by a keyboard or mouse driver. This way, anything which is done via those input devices can be simulated. As on top of ever windowed application you can use HWND handle, you can use it to bring with window on top, focus its control, etc., after that you can use
SendInput
. (Of, course, those tricks are dirty and error prone. If all depends on your purpose.)
—SA