5

One of the users of a Java swing GUI program that I wrote is having an issue where the main swing window doesn't render to the screen properly and the GUI freezes up. Here's a comparison of the screenshot on his screen (top) and what is supposed to show up (bottom):

alt text http://www.shapecollage.com/temp/SwingCorruption.jpg

He is running Windows XP SP3 with Java 1.6.0_13 and his graphics card is an ATI X1600 with a dual monitor set-up.

The program (if you would like to test for yourself) is at:
www.shapecollage.com/download.html

I have several thousand users and no one else has reported this error and I have tested it thoroughly on Windows XP. Anything computational is done in a separate thread from that of the regular GUI thread and the program works on many other computers, so I don't think it's a problem with the program itself, but rather, something wrong with his particular set-up.

Has anyone seen this type of error before on a system or have any suggestions as to what might be wrong on this user's system that would cause such a problem?

Thanks,
Vincent

4
  • 1
    Interesting. Such an issue was reported to me a year or two back; I could never reproduce it, so I closed it as probably a driver bug. I'll be interested to see if any good answers show up here.
    – Michael Myers
    May 15, 2009 at 19:44
  • Yikes! For it to be that bad it must be a jvm vs graphics driver thing - I doubt there's a lot you can do.
    – Tom
    May 15, 2009 at 19:51
  • Once the program is loaded, there are a few minor, but obvious artefacts in the rendering, and then when attempts are made to actually use the interface, it apparently goes crazy and it freezes. I cannot replicate this on my desktop or several other computers.
    – Vincent
    May 15, 2009 at 19:57
  • 1
    It pretty much has to be a driver problem.
    – KitsuneYMG
    May 15, 2009 at 20:27

5 Answers 5

6

Maybe there's a problematic interaction between Java and the graphics driver and/or graphics hardware.

There are several flags that can influence how Java draws to the screen.

You might want to try to start the applications with any of those flags:

  • -Dsun.java2d.opengl=true
  • -Dsun.java2d.d3d=false
  • -Dsun.java2d.noddraw=true

Those flags toggle the OpenGL pipeline, turn of using Direct3D and disable use of DirectDraw respectively.

If any of those solves your problem, then you might consider filing a Bug with sun, because then it's probably not the applications that's at fault here.

2
  • 1
    I had a related issue in which -Dsun.java2d.d3d=false solved the issue. See stackoverflow.com/questions/848481/…
    – Avrom
    May 18, 2009 at 14:07
  • 1
    Year 2015: In Ubuntu 14.04, graphics corruption in all gui controls, in my own application and in third party applications I use. Starting any of those with -Dsun.java2d.opengl=true solved the problem. This happens with NVidia cards, I think Intels are OK. Oct 24, 2015 at 3:59
2

We had a very similar problem, which was fixed by updating the graphics driver. The problem might come from the dual monitor setup leading to VRAM corruption, so your customer might try if it will work better with only a single monitor. While you might expect Java would not be very dependent on the hardware, our graphics-intensitive application always manages to BSOD when run through a particular projector type...

1
  • The user updated his graphics card driver and it fixed the problem.
    – Vincent
    May 21, 2009 at 4:22
1

I haven't seen that particular type of corrupted graphics, but I have seen Java graphics problems on Windows disappear when the hardware acceleration in the extended display control panel is reduced.

0

Swing isn't thread safe, so if you're doing the rendering anywhere other than the GUI thread, you can expect this sort of thing.

1
  • The rendering is only done in the GUI thread. The program works fine on thousands of other computers.
    – Vincent
    May 15, 2009 at 19:51
0

I have seen corrupted graphics like that, but never in java. The places i've seen it were in windows draw/etc code, and the tiling and snow look generally indicated something like telling the image draw code that you were going to draw an image of a certain size and bit depth, but then filling the image buffer with a different bit depth. like filling the byte array with data from an integer RGBA source and putting it into an integer RGB destination?

but from the screen shot, the user looks like they're also running some other kind of app too, as there's an extra button by the minimize/maximize/close buttons, so some other third party application is modifying the window. Maybe that's messing with it?

Otherwise i'd say driver issue. There's always some solutions like disabling d3d drawing or some other draw optimizations that the VM does automatically now, maybe that solves it?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.