Re: just on Linux: grey rectangles instead of JFrame
From: Tarlika Elisabeth Schmitz (invalid_at_invalid.invalid)
Date: 10/20/04
- Next message: Babu Kalakrishnan: "Re: Challenging Question on Glass Panes and JInternalFrames"
- Previous message: Paul Lutus: "Re: Drawing a grid"
- In reply to: Paul Lutus: "Re: just on Linux: grey rectangles instead of JFrame"
- Next in thread: Paul Lutus: "Re: just on Linux: grey rectangles instead of JFrame"
- Reply: Paul Lutus: "Re: just on Linux: grey rectangles instead of JFrame"
- Reply: Babu Kalakrishnan: "Re: just on Linux: grey rectangles instead of JFrame"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 20 Oct 2004 07:19:33 +0100
Hello Paul,
Thank you for your reply.
Paul Lutus wrote:
> Tarlika Elisabeth Schmitz wrote:
>
>>System:
>>- Debian Linux
>>- BlackDown 1.4.2, or Sun 1.4.2_03
>>- PC 512MB, 2.8 GHz, nothing else running
>>- Gnome 2.6
>>- Windowmanager: Sawfish or Metacity
>>
>>Application: single-threaded Swing application using JFrames. Some are
>>just hidden upon close, others are newly created each time.
>>
>>Test: just open, close, open, close windows
>>
>>Problem: 20-30% of the time a JFrame is not painted properly
>>a) just a grey rectangle
>>b) Window decorations drawn, but content just grey
>>c) content drawn but no Window Decorations
>>
>>This does not appear to be caused by uncaught exceptions.
>
> But it appears that you have not looked for error messages, so you really
> don't know if this is the cause. See below.
I realize now that I didn't express myself clearly enough:
I am always firing up the application from a shell. There are NO error
messages nor stack traces, therefore no uncaught exceptions. There are
also no caught exceptions in the logfile - I have written the
application myself, there is a log statement in every catch block.
>The phenomenon
>>appears without any errors being logged nor anything on the console
>>(neither stack trace nor out of mem).
>
>
> By "console" do you mean by launching your applications from a shell and
> monitoring for errors? This is a reliable way to see errors.
See above.
>>I first tried Blackdown 1.4.2. It doesn't take long to hit the problem.
>>De-installed Blackdown, installed Sun 1.4.2. Took much longer for the
>>problem to appear. I would like to emphasize again, that I have never
>>seen this on my Win2K machine with Sun SDK 1.4.2_01.
> Also make sure which JVM you are using. In the same shell from which you
> launch the applications, type:
>
> $ java -version
I tried both BlackDown and Sun's (see above). In fact, I now have two
otherwise identical test PCs, one using Blackdown, one Sun's.
==============
It seems I have solved the problem. I say "it seems" because the problem
is not reproduceable but used to occur within in minutes, which isn't
the case now.
I believe I was dealing with two independent problems:
1) Undecorated Windows: There seem to be incompatibilities between Java
and some WindowManagers if one can trust the various comments on the
net. Particularly Sawfish was mentioned, and indeed, the problem was
much worse. With some window managers the problem occurred more often
than with others. With Sawfish, for instance, some non-Java apps
occasionally appear undecorated, too.
2) Grey content: Threading problem caused by myself: My first window was
running on the main thread, the others on the event-dispatch thread.
Sometimes, I believe, both phenomenons occurred at the same time, i.e.
when I got an undecorated grey rectangle.
Solution:
1) Undecorated windows occurred pretty rarely with Metacity
(The new Gnome version only allows Sawfish or Metacity, so MC is my only
choice.) I have now set the default to
JFrame.setDefaultLookAndFeelDecorated(true), so that the closebox etc
are within Java's control. They have not disappeared [yet]. Not quite
what I wanted but there you go.
2) I forced the first JFrame onto the EDT with invokeLater. It seems as
though the occasional window had frozen up when I was running the Swing
stuff on two threads.
-- Regards/Gruß, Tarlika Elisabeth Schmitz
- Next message: Babu Kalakrishnan: "Re: Challenging Question on Glass Panes and JInternalFrames"
- Previous message: Paul Lutus: "Re: Drawing a grid"
- In reply to: Paul Lutus: "Re: just on Linux: grey rectangles instead of JFrame"
- Next in thread: Paul Lutus: "Re: just on Linux: grey rectangles instead of JFrame"
- Reply: Paul Lutus: "Re: just on Linux: grey rectangles instead of JFrame"
- Reply: Babu Kalakrishnan: "Re: just on Linux: grey rectangles instead of JFrame"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]