Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bold text in JComboBox with version 1.6.2 #423

Closed
clausnagel opened this issue Nov 14, 2021 · 4 comments
Closed

Bold text in JComboBox with version 1.6.2 #423

clausnagel opened this issue Nov 14, 2021 · 4 comments
Milestone

Comments

@clausnagel
Copy link

clausnagel commented Nov 14, 2021

After updating to version 1.6.2, the text in my JComboBoxes is rendered in bold. I downloaded the FlatLaf demo app, and it shows the same behavior. It seems that editable combo boxes are not affected. I'm using Eclipse Temurin 11.0.12+7 on Windows 10 to run the app.

image

@DevCharly
Copy link
Collaborator

Strange, don't have this effect on my main desktop PC (Windows 11), but on another PC (Windows 10).
The combobox text looks bold because it uses "grayscale" antialiasing. Otherwise "lcd" antialiasing is used.

This is caused by using a round rectangle for clipping. See commit 0b6df8b

@clausnagel
Copy link
Author

I am not using round components in my app. I tested the following:

  • added putClientProperty("JComponent.roundRect", true) to a single combobox: text is still bold
  • added putClientProperty("JComponent.roundRect", false) to a single combobox: text is not bold for this combobox anymore
  • added UIManager.put("Component.arc", 0) at the startup of my app: text is not bold for all comboboxes

So, the last option does the trick for me. Just wonder why it's necessary.

@DevCharly
Copy link
Collaborator

I am not using round components in my app.

Comboboxes, spinners and buttons, etc. have (small) round corners by default.

Just wonder why it's necessary.

Because the combobox has (small) round corners by default.
It is actually no problem with the small default corner radius because the border is painted over the background and "hides" the square corners of the background.

But if using larger corner radius (Component.arc) or JComponent.roundRect = true, then this happens before FlatLaf 1.6.2:

image

I'm working on a solution...

DevCharly added a commit that referenced this issue Nov 14, 2021
…n-editable combo boxes in bold (issue #423)

fixes commits 02f3239
and 0b6df8b
@DevCharly
Copy link
Collaborator

Fixed in 1.6.3. Thanks for reporting 👍

@DevCharly DevCharly added this to the 1.6.3 milestone Nov 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants