Using the Java Service Wrapper to start a Swing GUI application.
The Swing application is a JFrame desktop with JDiolog modal children frames.
When you logoff and back in, with a JDialog visible once you clear the JDialog there is a problem where the JFrame is not re-enabled. The desktop can not gain focus. The application in not even in the ALT+TAB list. This must be a java bug since I am able to duplicate this in java 1.3, java 1.4 and java 1.5.
We have found a workaround in C++ until Sun comes up with a fix but this workaround will not work if the application has sub menu items.
The workaround was to build an .exe that finds the JFrame Desktop window handle and calls the windows API EnableWindow(HWND, TRUE). This puts the application back into the ALT+TAB list and enables focus and all the listeners. Since any sub menu window has it's own window handle there is a problem where none of the listeners will work on the sub menu items.
The thought was to call EnableWindow(HWND, TRUE) on the sub menu items handles but those handles are not avaliable unless the menu is visible. This is where the problem is with the work around.
Can anyone help me out with a workaround. I have already submitted a bug with SUN and I am waiting for a response. It could be a long time before they do anything.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a complete sample application built along with the Java Service Wrapper setup in a .zip file that will take a few minutes to duplicate the problem. If anyone is interested in the zip file let me know and I can email it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Using the Java Service Wrapper to start a Swing GUI application.
The Swing application is a JFrame desktop with JDiolog modal children frames.
When you logoff and back in, with a JDialog visible once you clear the JDialog there is a problem where the JFrame is not re-enabled. The desktop can not gain focus. The application in not even in the ALT+TAB list. This must be a java bug since I am able to duplicate this in java 1.3, java 1.4 and java 1.5.
We have found a workaround in C++ until Sun comes up with a fix but this workaround will not work if the application has sub menu items.
The workaround was to build an .exe that finds the JFrame Desktop window handle and calls the windows API EnableWindow(HWND, TRUE). This puts the application back into the ALT+TAB list and enables focus and all the listeners. Since any sub menu window has it's own window handle there is a problem where none of the listeners will work on the sub menu items.
The thought was to call EnableWindow(HWND, TRUE) on the sub menu items handles but those handles are not avaliable unless the menu is visible. This is where the problem is with the work around.
Can anyone help me out with a workaround. I have already submitted a bug with SUN and I am waiting for a response. It could be a long time before they do anything.
Another note:
I have a complete sample application built along with the Java Service Wrapper setup in a .zip file that will take a few minutes to duplicate the problem. If anyone is interested in the zip file let me know and I can email it.
I'll have you send it to me directly and take a look.
Cheers,
Leif