I was so hoping someone could help me.
I saw a question like this a few weeks ago. If I'm asking something that's
already been answered or is in a FAQ or something, I'm really sorry.
None of my Java applications have frame decorations when run under Linux.
The exact same program will look "proper" on Win98SE, NT, and XP.
This affects *all* my Java applications - including 3rd-party and JDK demos.
And it doesn't matter if the application is AWT or Swing based.
It doesn't matter if I run the program on the console, from telnet, or
through xterm.
I never had this problem with previous versions of Java or Linux.
Here are all the specifics I can think of ...
RH7.x, kernel 2.4.20-24.8
GNOME desktop
(I don't use Java through gcc.)
These are the packages that are installed:
gcc-java-3.2-7
j2sdk-1.4.2-01
gnome-vfs2-2.0.2-5
libgnomeui-2.0.3-3
gnome-vfs-1.0.5-6
gnome-terminal-2.0.1-5
gnome-utils-2.0.2-5
libgnome-2.0.2-5
gnome-libs-1.4.1.2.90-22
gdk-pixbuf-gnome-0.18.0-4
gnome-system-monitor-2.0.0-2
gnome-vfs-extras-0.2.0-3
gnome-desktop-2.0.6-4
gnome-session-2.0.5-7
libgnomecanvas-2.0.2-1
gnome-vfs2-extras-0.99.5-1
gnome-media-2.0.0-9
gnome-applets-2.0.1-6
gnome-panel-2.0.6-9.2
XFree86-Mesa-libGL-4.2.1-23
XFree86-libs-4.2.1-23
XFree86-xauth-4.2.1-23
XFree86-font-utils-4.2.1-23
XFree86-100dpi-fonts-4.2.1-23
XFree86-4.2.1-23
XFree86-75dpi-fonts-4.2.1-23
XFree86-xdm-4.2.1-23
XFree86-tools-4.2.1-23
XFree86-twm-4.2.1-23
XFree86-base-fonts-4.2.1-23
XFree86-truetype-fonts-4.2.1-23
XFree86-Mesa-libGLU-4.2.1-23
XFree86-xfs-4.2.1-23
Even this simple little program can demonstrate my problem ...
If I compile/run this program on Linix, I get nothing but an immobile gray
box with my message in it.
If I compile/run this under Windows, all looks "normal."
import java.awt.*;
import javax.swing.*;
public class noframe extends JFrame
{
public noframe ( String title ) { super( title ); }
public static void main ( String[] args )
throws ClassNotFoundException,
InstantiationException,
IllegalAccessException,
UnsupportedLookAndFeelException
{
noframe noframe1 = new noframe( "You'll Never See This" );
noframe1.setSize( 300, 300 );
noframe1.setLocation( 100, 100 );
JLabel label1 = new JLabel( "This shows fine", JLabel.CENTER );
noframe1.getContentPane().add( label1 );
noframe1.setVisible( true );
}
}
Dances With Crows - 09 Dec 2003 00:28 GMT
["Followup-To:" header set to comp.os.linux.x.] On Mon, 08 Dec 2003
23:22:31 GMT, samantha staggered into the Black Sun and said:
> I was so hoping someone could help me. I saw a question like this a
> few weeks ago. If I'm asking something that's already been answered
[quoted text clipped - 10 lines]
> Here are all the specifics I can think of ...
> RH7.x, kernel 2.4.20-24.8
What's the x? Redhat 7.0 is very different from Redhat 7.3, and they're
both kinda obsolete (end RPM Dependency Hell, move to Debian or Gentoo
today!)
> GNOME desktop
> j2sdk-1.4.2-01
I think it's a problem with your GNOME config, not an X problem, not
really a Java problem. I compiled the code on my Linux desktop using
the Blackdown 1.4.1 JDK/JRE and saw perfect window decorations and
titles (but I'm using KDE 3.1; I'm not a big fan of GNOME.) Which window
manager are you using? Check its control panel/look-n-feel and see if
there's something about "apply GNOME look-n-feel to non-GNOME
applications", or anything about handling window manager hints, or
something.
> Even this simple little program can demonstrate my problem ...
[snip code]
Hm. There's no exit handler, and I had to kill -HUP it. Oh well...
HTH anyway.

Signature
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin / mail: TRAP + SPAN don't belong
http://www.brainbench.com / Hire me!
-----------------------------/ http://crow202.dyndns.org/~mhgraham/resume
hiwa - 09 Dec 2003 06:05 GMT
> I was so hoping someone could help me.
> I saw a question like this a few weeks ago. If I'm asking something that's
[quoted text clipped - 73 lines]
> }
> }
That is quite abnormal situation. I recommend you to re-install a
latest version of Linux distribution. Red Hat 9 on my machine does not
generate your problem.
samantha - 09 Dec 2003 16:59 GMT
Thanks for the advice, hiwa.
If only I could afford to upgrade to RH9.
But it can't be a simple "upgrade to fix" kind of problem.
As I said before, OLDER versions of RH and Java never presented these
problems.
I understand how things change over time; I understand how problems are
often caused by a combination of factors. Knowing how an upgrade can
possibly "re-synchronize" certain aspects of the system so all works
smoothly again, I'm still not willing to accept that idea that "buying a new
car" (or in this case, "replacing the engine") is the best solution. I
think I'd sooner revert to an older version of RH and Java where all was
stable and working then go through yet another reinstallation of Linux and
all my files, libraries, and programs. I spend more time preserving my
environment, reinstalling/updating the OS, and restoring my environment,
than I do developing. This really IS like the "old PC days."
I love UNIX. I have since the 70's. But I'm sorry ... it's problems like
this that cause me to make Wintel my platform of choice. NT and XP crash
left and right - where as NONE of my Linux boxes have EVER crashed - but the
Windows apps (while not always stable) are much more consistent in behavior.
Maybe I'm just lucky, but I've never had a Windows app "stop working" when
I've patched the OS. Hell, every single NT app has worked flawlessly for me
in XP. I then ventured into 98SE on several laptops and had no problems.
Like I said, maybe I'm one of the lucky ones. Well, I guess the Universe
balances things out: I have had such miserable luck with Linux.
Thanks again for the "to RH9" suggestion. I may complain a lot about making
the upgrade, but I'm sure - when I can afford it - I'll do it. <sigh> The
never-ending quest for both a stable AND consistent Linux environment.
Let's just hope it's not a pipe dream.
- sam
> > I was so hoping someone could help me.
> > I saw a question like this a few weeks ago. If I'm asking something that's
[quoted text clipped - 77 lines]
> latest version of Linux distribution. Red Hat 9 on my machine does not
> generate your problem.
Antti S. Brax - 09 Dec 2003 07:41 GMT
sammystinger@yahoo.com wrote in comp.lang.java.gui:
> Here are all the specifics I can think of ...
> RH7.x, kernel 2.4.20-24.8
> GNOME desktop
> (I don't use Java through gcc.)
What does "java -version" say? Do you have anything on your
CLASSPATH?

Signature
Antti S. Brax - asb(at)iki.fi Rullalautailu pitää lapset poissa ladulta
http://www.iki.fi/asb/ http://www.cs.helsinki.fi/u/abrax/hlb/
samantha - 09 Dec 2003 16:19 GMT
java -version reports
java version "1.4.2_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_01-b06)
Java HotSpot(TM) Client VM (build 1.4.2_01-b06, mixed mode)
My CLASSPATH was the first thing I looked at. Even with it reset to
CLASSPATH=.
I have the same problem. :I
> sammystinger@yahoo.com wrote in comp.lang.java.gui:
> > Here are all the specifics I can think of ...
[quoted text clipped - 4 lines]
> What does "java -version" say? Do you have anything on your
> CLASSPATH?
hiwa - 09 Dec 2003 11:59 GMT
What window manager and its theme are you currently using?. Is it
something of a fancy/problematic one?
samantha - 09 Dec 2003 16:37 GMT
I've switched to KDE 3.0.5a-5
I now have decorations locally - when running my Java applications on the
console.
What could this mean? The installation of KDE added/removed/tweaked
something important?
However, I still don't have decoration when running my Java applications
remotely - Exceed as my X server and launching Java application within a
telnet or xterm session.
So could it be an Exceed problem after all? It couldn't be *only* an Exceed
problem as my version of Exceed (6.1) hasn't changed in quite a while.
Things used to work with older versions of RH and Java. So with the same
Exceed but newer RH and Java, things won't work. :( It must be one of the
magical, mystical "combination" things.
- sam
> What window manager and its theme are you currently using?. Is it
> something of a fancy/problematic one?
hiwa - 11 Dec 2003 09:42 GMT
> I've switched to KDE 3.0.5a-5
> I now have decorations locally - when running my Java applications on the
[quoted text clipped - 15 lines]
> > What window manager and its theme are you currently using?. Is it
> > something of a fancy/problematic one?
Why you don't use stock XFree86? Java may conform to it.
Stuart Levy - 15 Dec 2003 07:07 GMT
>I've switched to KDE 3.0.5a-5
>I now have decorations locally - when running my Java applications on the
[quoted text clipped - 10 lines]
>Exceed but newer RH and Java, things won't work. :( It must be one of the
>magical, mystical "combination" things.
Again not an answer, but might give a clue if you feel like
tracing the source of this problem: try running
"xprop" and clicking on one of the undecorated windows.
The window manager decides whether to apply decorations
based on things like:
- _MOTIF_WM_HINTS
fields in this can ask the window manager to decorate or not
(as described in e.g. /usr/X11R6/include/Xm/MwmUtil.h)
Some non-Motif window managers may pay attention to this too...
- _OL_WT_BASE
similar to the above, apparently used by Sun's Open Look Window
Manager; maybe Java now sets this, or used to and now doesn't...
- WM_TRANSIENT_FOR
Some window managers may avoid decorating windows tagged with this property
- the WM_CLASS or WM_NAME of the window
(though it's probably not the problem here, window managers can be
configured to never decorate windows from such-and-such application)
Of course it'd be handiest if you can run apps under both your
new and old Java installations and compare what xprop reports -- I
don't remember if you mentioned having the old Java still installed.
The decoration rules depend not only on the window properties (which might
be different under a new java release) but also, of course, on the particular
window manager and its settings. So it's unfortunate but plausible that
KDE with default settings might behave differently from Gnome
(maybe Enlightenment window manager??) with its default settings, and why both
might differ from whatever WM you get with Exceed. This kind of behavior is
unfortunately just not standardized.
[Hmm, the first result in a google search for "exceed window manager"
turned up someone with a problem like yours -- that Java application
windows are undecorated! Dave Pelletier replied, suggested changing
the choice of window manager:
``Go to Xconfig>Screen Definition and change the Window Manager from
"Default to Native" to Native. Retry the application.''
]
Cheers
Stuart