JDK-8231386 : [macos] on Aqua LookAndFeel selection of the text in JEditorPane is not visible on macOS
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 13,14,15
  • Priority: P3
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: os_x
  • CPU: generic
  • Submitted: 2019-09-24
  • Updated: 2022-07-06
  • Resolved: 2022-07-06
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
Relates :  
Relates :  
Description
To reproduce the problem case1:
 - Set dark mode in macOS
 - Set Highlight color to "Graphite"
 - Run the SwingSet2
 - Open the source code of any demo
 - Press cmd+A to select the whole text
 - Text selection will not be visible
 - Move the focus out/in of the text component, selection becomes visible

To reproduce the problem case2:
 - Set dark mode in macOS
 - Set Highlight color to "Graphite"
 - Run the SwingSet2
 - Open JInternalDemo
 - Try to select "Frame" text in the internal frame
 - The text itself and selection will disappear(we will draw white on white?)

The bug can be reproduced on macOS 10.15 Beta 9 (19A573a), I do not know when it was introduced.

The Aqua L&F is affected only.


Comments
Text Highlight selection is visible
06-07-2022

Reproduced on macOS Mojave in DarkMode as well.
27-09-2019

In the light mode the "Graphite" color is reported as r=217,g=217,b=217,a=255 In the dark mode the "Graphite" color is reported as r=255,g=255,b=255,a=63 As far as I understand it is expected that in the dark mode this selection will be used on top of the dark background, where the light selection will be visible. So the bug exists because the Swing uses a white background as a default color for text components, and at the same time use the native color to highlight the selection which may not be visible on white The root cause is different but the bug is similar to JDK-8228555.
24-09-2019

Looks like the root cause is that the "Graphite" color is transparent(alpha = 63) and we skip it for some unknown reason.
24-09-2019