In Java 1.4 you could use ((SunToolkit) Toolkit.getDefaultToolkit()).getNativeWindowHandleFromComponent() but that was removed.
It looks like you have to use JNI to
This little JNI method accepts a window title and returns the corresponding window handle.
JNIEXPORT jint JNICALL Java_JavaHowTo_getHwnd
(JNIEnv *env, jclass obj, jstring title){
HWND hwnd = NULL;
const char *str = NULL;
str = (*env)->GetStringUTFChars(env, title, 0);
hwnd = FindWindow(NULL,str);
(*env)->ReleaseStringUTFChars(env, title, str);
return (jint) hwnd;
}
UPDATE:
With JNA, it's a little bit easier. I made a small example which find the handle and use it to bring the program to front.