JDK-8294921 : Background color visible at edges of EtchedBorder
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 11,17,19,20
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2022-10-06
  • Updated: 2023-01-03
  • Resolved: 2023-01-03
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.
Other
tbdResolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Sub Tasks
JDK-8299553 :  
Description
The fix for JDK-8279614 addressed the inconsistent rendering of EtchedBorder in HiDPI environment, in particular at 150. And works well for the cases where background of the component is the same as of its parent.

Yet if the background is different, it shines through the border.

At 100% scale, there's 1-pixel white background on the bottom and right; at 125% scale, there's 1-pixel white background on the top and right.

To reproduce, run the attached Java app, EtchedBorderBackgroundTest.java, or refer to the screenshots.
Comments
Closed as dup of JDK-8294680.
03-01-2023

I ran my updated test, and the code in the PR for JDK-8294680 does fix the issue. I propose closing this bug as duplicate. I submitted the PR to contribute the updated test under the sub-task JDK-8299553.
03-01-2023

[~aivanov] This same JBS issue can be use to add the new test since nothing is being committed as part of this bugid and the refactoring changes are committed/ tracked as part of JDK-8294680.
12-12-2022

Perfect! I'll add the updated test… under a bugid. Probably a new one.
12-12-2022

The refactored code has been tested and with the fix, the 1-pixel white line is no longer seen. Screenshots attached for 100% and 125% scaling.
07-12-2022

dup of JDK-8294680 should be confirmed once JDK-8294680 fixed
18-11-2022

This issue will be automatically fixed once JDK-8294680 is fixed.
18-11-2022

The idea that came up to me during yesterday's discussion has resolved the problem that we had for JDK-8282958. It'll go with these changes. Then, JDK-8294680 is to move handling managing the scale to a utility method. Once this is done for JDK-8279614, the first fix in the series, as well as JDK-8015739 and JDK-8282958, we'll get unified handling, which should resolve this bug automatically, thanks to the updated calculation of {x,y}translation and width/height. At the same time, I think exploring a solution with LayoutManager still makes sense.
07-10-2022

Alexey was discussing a possible solution with Rajat and me about a possible fix for this bug. Since all fractional scalings are .25, .5, .75, if we change layout manager to force height and width to be divisible by 4, the resulting the scaled widths and heights will be integers (and probably can avoid problems with rounding). It could cause problems with some applications so we're still exploring possible solutions
07-10-2022

When the app is run with Java 17, the background does not shine through at 100%. If the scale is 200%, there's 1-pixel white line of background outside the border on the bottom and right. At 125% and 150%, different edges of the etched border look differently, as reported in JDK-8279614, in particular there's 1-pixel white line between the border lines on the left and top at 125%, and at 150% this 1-pixel while line is present on all the edges, the right edge renders the shadow of the etched border 2-pixel wide.
06-10-2022