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

Harshitha Onkar honkar at openjdk.org
Wed Aug 17 00:17:25 UTC 2022


On Tue, 16 Aug 2022 17:30:32 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:
> 
>   Modified test for native sizing.

Tested on Mac 12.3. The editable combobox looks quite close to the non editable one. 

> Ideally, the textfield also should have a focus border around it similar to button, so it will look uniform, so instead of removing border from button, we can try to draw focus border around textfield.

Just a thought: As @prsadhuk suggested earlier, carrying forward the focus ring style & thickness of the button over to the textfield might help in giving the editable combobox (textfield + button) a unified look when it has focus.

![image](https://user-images.githubusercontent.com/95945681/185005697-be9eb779-15fb-4792-95df-77c3917a80cc.png)

![image](https://user-images.githubusercontent.com/95945681/185005741-1bb845c2-4aad-41b0-bf0e-1e965dc7c9c2.png)

Minor changes:
Copyright year for AquaComboBoxUI needs to be updated
Adding MacOS test - either in the instructionText or summary of the test.

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

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



More information about the client-libs-dev mailing list