Swing and Unix

We use a Unix terminal emulator like xterm at work to connect to our Unix machines from our PCs. I need to set up an interactive form that can display form elements (like toggle, radio, buttons, drop-down lists, etc). I thought it'd be a simple thing to use Java's Swing classes to help with this, but when I try to create a JFrame from Unix, it disrupts all open xterminals (temporarily removing borders, menus, title bars, etc). Has anyone had a similar problem? And if so, how did you fix it? What other solutions might I consider? Unfortunately, I haven't discovered a native UNIX utility installed on our machines that can handle cursor placement in the terminal window.

It sounds like the Swing GUI is for some reason crashing your window manager (which one are you using, do you know), which is then automatically restarting. You might want to check your X log files for any error messages or clues about why it's falling over, and also try perhaps using a different window manager temporarily to see if it works around the problem.

We use XManager. The problem is, I can't ask everyone in my company to start using a new terminal program. I either have to solve the problem by setting something with a shell script before creating the swing components, or something else. I'm running out of ideas. I have no idea where or if X logs are being created.

I realise that, I'm just suggesting this as a temporary troubleshooting step to narrow down the source of your problem. I'm not familiar with XManager... what operating system and desktop are you using (CDE? Gnome?).

Perhaps my newbie status is showing through a bit much and I'm not explaining things correctly. The end user of my application is on a Windows XP pc. They connect to our UNIX machines via XManager, which runs X applications. We use xterm (/usr/bin/X11/xterm).

I am wanting to display a form to the user that will allow them to select certain files and then do some validation. The files are on the UNIX file-system, which they are accessing via xterm. When I try to start a java program that uses Swing, as soon as it tries to display the JFrame (I've also tried with AWT Frames), all open XManager xterm windows are disabled and lose borders, buttons, etc.

I've researched and found bits and pieces of people grumbling about the same thing, but no solution. It may be that Swing/AWT is just not compatible with our interface with UNIX. But I don't know what else to try.

Have you tried with any of the the SwingSet2 sample applications? They should be the lowest-common-denominator of Java/Swing applications to test with I'd guess.

From what you say it sounds like XManager running on the Win32 end is the window manager in question, and probably most likely at fault. I'd investigate whether it has a logging mechanism or any way to turn such a facility on if it is off by default.

Do you have any other X server software for Win32 you can test with? Hummingbird Exceed, X-Win32, Cygwin/X and TEDeXtend are some that I can think of...

Also, can you launch other vanilla X applications fine from the xterm, such as xclock?

xclock works. I haven't found any logging capability of the XManager application. No other x server software that I know of.

Well, I just installed the Xmanager 3.0 trial version, connected to a HP-UX box, opened an xterm and ran java -jar /opt/java1.40B/demo/jfc/SwingSet2/SwingSet2.jar which opened successfully... so it should work in principle. What version of Xmanager are you using?

XManager 2.0. That's good to know.

Thank you for your help. XManager 2.0 does not work, but XManager 3.0 does. Unfortunately, I'm going to have to come up with another solution because getting XManager 3.0 installed on everyone's pc's is not something my company is willing to do at this time. :mad:

I presume you have a site licence of some sort for Xmanager... in which case I'd say you'd be entitled to go to Netsarang for support, at the very least an explanation of why it's not working for you and whether there are any known workarounds under v2. They also have a support forum on their site where it might be worthwhile posting to compare notes with other users. Good luck!