javaswingpaint

Paint refresh problem in Java 1.6 Swing app


I'm working on a Swing application (currently running on Java 1.6 update 11) which has some intermittent paint refresh problems (e.g. there are artifacts etc.). This only happens to some users of our application but not others.

After doing some research, I found that setting the property sun.java2d.d3d to false may help and in fact, it helped for one of our users.

Now that some other users are complaining about the issue, I'm thinking of setting the property to false for all users.

My basic questions are the following:

What exactly is the cause of this? Is it the video card? Is it the driver? Is it a bug from Sun (such as JDK-6635462 : D3D: REGRESSION: XOR rendering is extremly slow)? Combination of all three?

In other words, is is best to simply turn this property off or is it affecting only certain video cards in which an update to the latest driver would fix?


Solution

  • Java introduced in R6 update 10 a pipeline that renders graphics based on Direct3D. According to the release description here it supports only NVidia and ATI cards, which means anyone not using those cards may have a problem. Since it is a recent innovation I would suggest that anyone using old drivers for those cards may also have problems. Upgrading a video driver will probably fix the first case but not the last.

    If you set sun.java2d.d3d to false the worst that can happen is that some users will not achieve the performance that they theoretically could. You will have to balance whether this is preferable to the issues that you are seeing at the moment.