RFR: 8054572: [macosx] JComboBox paints the border incorrectly [v7]

Harshitha Onkar honkar at openjdk.org
Thu Sep 8 20:58:41 UTC 2022


On Wed, 17 Aug 2022 22:37:46 GMT, Damon Nguyen <dnguyen at openjdk.org> wrote:

>> When a JComboBox is editable, the button segment of the combo box is misaligned vertically and has a different height. This change fixes these issues and adds a manual test that checks the appearance of an editable and non-editable JComboBox.
>> 
>> One of the discussions revolving this issue is the native macOS appearance of editable JComboBoxes. After looking through native macOS apps, the only one found is in System Preferences > Date & Time. The problem here is that the native equivalent found here uses a blue button with a single down arrow as the button's symbol. The current swing implementation uses a white button with an up & down arrow symbol for the button. A JRS widget button that has this blue button with a single downward arrow exists but does not support text fields.
>> 
>> As such, I believe the best fix for this issue is to mainly fix the alignment and sizing issue. I looked through Apple's documentation for these UI elements but editable JComboBoxes aren't specifically listed anywhere. Similarly, there's barely any editable JComboBoxes used in native mac apps (only the date & time). So, I don't think it's a major issue if JComboBox does not exactly match the example found in Date & Time.
>
> Damon Nguyen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Updated copyright date. Added MacOS text to test.

Tested on non-retina display, combobox height of 22 works well. 
Increasing or decreasing the height by 1 produces slight offset. I think height=22 works well here.

**With Height = 23**
![image](https://user-images.githubusercontent.com/95945681/189221941-c0293708-0369-41dc-b765-32d7c2985345.png)

**With Height = 21**
![image](https://user-images.githubusercontent.com/95945681/189222977-763b3e49-a4d6-47e9-9445-c3caf5baeb66.png)

-------------

PR: https://git.openjdk.org/jdk/pull/9473



More information about the client-libs-dev mailing list