Skip to main content

AWT painting issue w/ NVIDIA 7300 GS and getInsets()

3 replies [Last post]
Joined: 2008-04-25
Points: 0

I posted a bug to the BugDB, but I seem to be having an issue with legacy AWT painting code in 1.6.0u10. In particular, if the getInsets() method is overriden *AND* I run the following code on a machine with an NVDIA 7300GS graphics card, the output is different -- a rectangular box is painted in a different area of the screen than if the getInsets() method were not overridden. When I switched the machine to using an internal Gfx card, the problem went away. Upgrading to the latest NVIDIA drivers didn't seem to help much either.

<p>import java.awt.*;<br />
import java.awt.event.*;</p>
<p>// Test Class to show insets problem<br />
public class AWTTestInsets {</p>
<p>     public static void main(String[] args) {</p>
<p>         final Frame f = new Frame("AWT Test - Insets");<br />
<p>         f.addWindowListener(new WindowAdapter() {<br />
             public void windowClosing(WindowEvent e) {<br />
                f.setVisible(false);<br />
                System.exit(0);<br />
            }<br />
<p>         f.setBackground(Color.gray);<br />
         Panel p = new Panel(){<br />
             //t,l,b,r<br />
             public final Insets INSETS = new Insets(40,40,40,40);                     </p>
<p>             // override the getInsets() method ...<br />
             public Insets getInsets() {<br />
                 return INSETS;<br />
             }       </p>
<p>             public void paint(Graphics g) {<br />
                 g.setColor(;                                                 </p>
<p>                 // draw a 100x100 pixel blue rectangle starting at offset 100,100<br />
<p>             }<br />
         };<br />
         f.add(p);<br />
<p>    }</p>

I've attached a screen shot showing the machine with the NVIDIA 7300 GS running two versions of the above code. The one on the right is the same code as above with the getInsets() method commenting out (not overriden). The painting code itself DOES NOT rely on the insets in any way in both examples, which is why this bug is so weird.

I've only been able to see this bug with 1.6.0u10 running on DELL GX620's that have NVIDIA 7300 GS video cards. Other machine configurations are not affected and unfortunately, I don't have a lot of other NVIDIA cards lying around to test out. Perhaps someone has a 7300GS or another NVIDIA card and can re-produce this issue.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2006-07-30
Points: 0

Hi jaydkay,

I have opened a bug report for you for this issue. The bug ID is 6694230.

Please try to run your application with the following runtime argument and see if the issue is reproduce:

If not reproducible, please set the environment variable below to make sure Direct3D pipeline is enabled:
and send me the output.

Roger Y.

Joined: 2008-04-25
Points: 0

Hi, I set the [b]sun.java2d.d3d[/b] system property to false and it fixed the problem. This is a suitable workaround for me right now. I also ran this using SWING painting/components and I didn't see the problem either, looks like only AWT painting is affected Also tested on Nvidia 6600 and the bug was producible there as well. Here's my output with the verbose tracing flag on...

[I] OS Version = OS_WINXP Pro
[I] CheckAdaptersInfo
[I] ------------------
[I] Adapter Ordinal : 0
[I] Adapter Handle : 0x10001
[I] Description : NVIDIA GeForce 6600
[I] GDI Name, Driver : \\.\DISPLAY1, nv4_disp.dll
[I] Vendor Id : 0x10de
[I] Device Id : 0x0141
[I] SubSys Id : 0x21931682
[I] Driver Version :
[I] GUID : {D7B71E3E-4201-11CF-CB6A-990103C2CB35}
[I] D3DPPLM::CheckDeviceCaps: adapter 0: Passed
[I] ------------------
[I] D3DGD_getDeviceCapsNative
[I] D3DContext::InitContext device 0
[I] D3DContext::ConfigureContext device 0
[I] D3DContext::ConfigureContext: successfully created device: 0
[I] D3DContext::InitDevice: device 0
[I] D3DContext::InitDefice: successfully initialized device 0
[V] | CAPS_PS30

(btw, this is the debug output on the 6600 (which had the same issues as the 7300GS)


Cliff J.

Message was edited by: jaydkay

Joined: 2003-12-31
Points: 0

Thanks for the report. This is a bug (filed as 6694230). The fix is in the works,
hopefully will be available in b24.

Java2D Team