JDK-8233789 : A part of frame line of JComboBox lacks with HIDPI
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 11,14
  • Priority: P5
  • Status: In Progress
  • Resolution: Unresolved
  • OS: windows_2012
  • CPU: x86_64
  • Submitted: 2019-11-07
  • Updated: 2023-09-01
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
tbdUnresolved
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
openjdk version "14-ea" 2020-03-17
OpenJDK Runtime Environment (build 14-ea+17-721)
OpenJDK 64-Bit Server VM (build 14-ea+17-721, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Windows Server 2012

A DESCRIPTION OF THE PROBLEM :
A bottom line of frame of JComboBox lacks if HIDPI is enabled.

"-Dsun.java2d.uiScale=1.5" option could also recreate the problem.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Change display mode to 150%
2. Launch SwingSet2 demo
> java -jar SwingSet2.jar
3. Change Look and Feel to "Windows Style Fook & Feel"
4. Move to ComboBox demo

EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected:
Box frame appears around JComboBox.

Actual:
The bottom line of frame of the 3rd JComboBox is lacking.

REPRODUCIBILITY :
This bug can be reproduced always.
Comments
I see the similarity in the bug you linked. I can also see the behavior described. I originally thought it was XP Style, but saw that none of the paintBorders were affecting the border in SwingSet2. I've updated the code locally and now understand the changes in JDK-8294427
25-07-2023

The border is drawn by XPStyle. I believe the line goes missing because of scaling in CachedPainter. The same issue occurs for JInternalFrame if the scale is not a whole number. It is even easier to reproduce: the right and bottom borders of the internal frame appear and disappear as you move the frame around. To see this effect, you need a build with JDK-8139392. As I said in the code review [1] for JDK-8294427, we should re-implement XPStyle without basing it on CachedPainter to avoid any scale transformations being applied to keep the image crisp. This issue probably falls into the same category. [1] https://github.com/openjdk/jdk/pull/13701#discussion_r1227173718
21-07-2023

Tested and reproducible on JDK 22. Tested using SwingSet2 and with locally created test using Windows LAF (non-classic). The XP style does not draw the bottom line of the border for the JComboBox. Adjusting the bounds of the JComboBox nor modifying the minimum size of the object resolves the issue. The border seems to be attached to the Button. None of the paintBorder methods in WindowsBorders are called. Currently investigating XP style related classes for Button to find where border is being drawn.
19-07-2023