JDK-6661455 : Toplevel windows are not curve like native in windows
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u10
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2008-02-11
  • Updated: 2011-01-19
  • Resolved: 2008-02-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
6u10 b12Fixed
Related Reports
Relates :  
Relates :  
I have a frame which contains a button, on clicking on the button a dialog is displayed. I can see that frame & dialog upper corners are not round either they are dark extra pixel is seen like a square. I have attached the screen shot. This works fine in 6u10 b11 promoted build. but fails in 6u10 b12 pit build . Hence its a regression introduced in pit build.

Step to reproduced:-
1) Run the attached testcase.
2) You can see the frame. Observe that frame's top left & right corner are not round either an extra dark blue square can be seen. 
3) Click on the button to display a dialog. Observe that top left & right corner are not round either an extra dark blue square can be seen.  If you see the same then the bug is reproduced.

EVALUATION Seems that Windows sets a rectangular shape when invoking SetWindowRgn(). And then reshapes window (adding these fance curve corners) only on subsequent resize. A possible solution is to not invoke the SetWindowRgn() if no shape has been set by the user.

EVALUATION After resizing the window, its shape gets restored to the default (with the curve corners).

EVALUATION This is a regression caused by 6633275.

SUGGESTED FIX --- old/src/share/classes/java/awt/Window.java 2008-02-11 15:00:28.000000000 +0300 +++ new/src/share/classes/java/awt/Window.java 2008-02-11 15:00:28.000000000 +0300 @@ -645,7 +645,9 @@ super.addNotify(); // Applying the effects - applyShape(); + if (shape != null) { + applyShape(); + } applyOpaque(); applyOpacity(); }