JDK-8203281 : [Windows] JComboBox change in ui when editor.setBorder() is called
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 9,10,11
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • CPU: x86_64
  • Submitted: 2018-05-14
  • Updated: 2020-09-18
  • Resolved: 2018-10-04
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
11.0.10-oracleFixed 12 b17Fixed
Description
A DESCRIPTION OF THE PROBLEM :
The border which is supposed to paint around a combo box is not painted instead text field is covering the combobox border.


REGRESSION : Last worked in version 10.0.1


---------- BEGIN SOURCE ----------
import javax.swing.*;
import javax.swing.plaf.basic.BasicComboBoxEditor;

public class ComboUI {
    public static void main(String[] args) throws ClassNotFoundException, UnsupportedLookAndFeelException, InstantiationException, IllegalAccessException {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        JFrame frame = new JFrame();
        JPanel panel = new JPanel();
        JComboBox comboBox = new JComboBox(new Object[] {"apple", "ball"});
        comboBox.setEditable(true);
        //Reproducible as BasicComboBoxEditor call's setBorder(null)
        comboBox.setEditor(new BasicComboBoxEditor());
        panel.add(comboBox);
        frame.add(panel);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);
    }
}
---------- END SOURCE ----------

FREQUENCY : always



Comments
Fix request (11u) -- will label after testing completed. This downport was requested on the mailing list. http://mail.openjdk.java.net/pipermail/jdk-updates-dev/2020-July/003437.html It seems feasible to me. It's a rather small change. Thus I'll bring it to 11.0.9 if approved. Applies clean.
06-07-2020

Was able to reproduce the issue in latest JDK11 with Windows 7 also. Added "JDK_11_Windows7.JPG" for reference.
18-05-2018

Reported with JDK 10.0.1 in Windows 10, JComboBox change in ui when editor.setBorder() is called Checked this for reported JDK versions in Windows 10 and could confirm the issue as reported (see attached screenshot) The issue is restricted to Windows only and does not affect MAC and Linux. Results: ======== 8u172: OK 9: Fail 10.0.1: Fail 11 ea b13: Fail This is a regression in JDK 9 and onward. To verify, run the attached test case with respective JDK versions.
16-05-2018