I have a very weird problem with a Java GUI that I've built at work. It is so weird I don't even know where to start to look for help!! I hope this is the place; if not, I apologize.
We have a standalone system at an offsite location consisting of a Windows PC, running XP, and a SuSE Linux machine. I built a Java GUI that runs some bash scripts on the Linux machine. The GUI is started from the Windows machine because the user is not a Linux person. The GUI was built to replace scripts that presented the user with command line prompts for providing inputs to the main processing scripts.
The user clicks an icon on the windows desktop which runs a DOS batch (*.bat) file. The batch file uses plink, with a stored PuTTY session, to connect to the Linux machine and to execute a "java -jar XXX.jar" command to start the GUI. The GUI displays on the Windows PC due to Cygwin/X X Server running on the windows PC.
Okay. Now for the weirdness. If I leave the GUI in the location where it initially pops up, everything is fine. If I move the GUI, then the pulldown menus (dropdown combo boxes and menubar pulldowns) no longer work properly. And ONLY the pulldown menus. Everything else works fine (pushbuttons, text fields, ...). If I move the GUI back to its original location, everything works fine. If I click, hold and drag the mouse cursor over to where the GUI initially popped up (leaving the GUI where I moved it) the pulldown menus work properly.
At first I thought I had a problem with the way I initialized the pull down menus but I'm not so sure anymore. I'm wondering if there is something weird going on with the windows <-> putty <-> linux or the Xwin setups.
Contributing to not being able to solve this is that I cannot replicate this behavior at work. Unfortunately we don't have an exact replica of the offsite system; I'm testing/building this GUI on a XP to Debian Linux machine.
As anybody seen anything like this? Any suggestion as to what might be going on here?
You could check your use of the event dispatch thread -- that's a likely culprit if you really have checked the swing code for improper construction, etc.
Can you run the program on the Linux machine directly, to see if the UI will run normally there without Windows involvement? That would tell you whether it is in the Swing or in cross-computer UI system.
You might consider writing a Windows application that passes the necessary commands to the other system to execute in command-line style.
Joined: Jan 26, 2012
Hi, I "solved" this problem by reworking the Java GUI to start/run on the windows machine and use plink to execute commands on the linux machine.