JDK-8218473 : JOptionPane display issue with GTKLookAndFeel
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 8u202,9,10,11,12,13
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2019-02-05
  • Updated: 2019-09-26
  • Resolved: 2019-02-15
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.
JDK 11 JDK 12 JDK 13 JDK 8 Other
11.0.4-oracleFixed 12.0.2Fixed 13 b09Fixed 8u221Fixed openjdk8u222Fixed
Related Reports
Relates :  
Relates :  
Description
Running any Swing app having a JOptionPane with a text field component with GTK L&F (-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel) leads to component not being correctly rendered with highlighted text - please see the attached screenshots

For example for JOptionPane with a text field, the default text in the field prompt is not highlighted for GTKLookAndFeel 
Comments
Fix Request This issue solves GTK 3+ compatibility problem. Patch applies cleanly to 11u (and I see 11.0.4-oracle), and to 8u with reshuffling (and I see 8u221/222). Original test works fine after the patch, and looks wrong before the patch. 8u requires -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Djdk.gtk.version=3 to reproduce. The risk is minimal.
18-03-2019

This issue is release noted by JDK-8218469
14-02-2019

GTK3 does not set selected background color for the TEXT_FIELD widget anymore. The fix is pretty trivial: take selected color from the TEXT_AREA. --- a/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c Mon Feb 04 21:42:47 2019 +0100 +++ b/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c Fri Feb 08 11:56:25 2019 -0800 @@ -2274,6 +2274,11 @@ init_containers(); + if (widget_type == TEXT_FIELD && state_type == GTK_STATE_SELECTED && + color_type == BACKGROUND) { + widget_type = TEXT_AREA; + } + gtk3_widget = gtk3_get_widget(widget_type); GtkStyleContext* context = fp_gtk_widget_get_style_context(gtk3_widget);
12-02-2019

This is P1 TCK-RED issue for JDK 12 GA release. The fix is in progress.
08-02-2019