JFormDesigner / FlatLaf

FlatLaf - Swing Look and Feel (with Darcula/IntelliJ themes support)
https://www.formdev.com/flatlaf/
Apache License 2.0
3.42k stars 272 forks source link

IconImage to JButton not set with the correct distance when using setDefaultButton() #506

Closed adriankiess closed 2 years ago

adriankiess commented 2 years ago

Dear FlatLaf developers,

I use the FlatLaf libraries in four little Java Swing applications which I have coded.

On most of the look and feels, except the FlatLaf main default look and feel, when using a JButton which is set to default Button with getRootPane().setDefaultButton(), flatlaf-setdefaultbutton-iconimage-does-not-align-correctly the IconImage of that JButton has not enough distance to the the buttons text.

This issue is there since I use the FlatLaf libriaries (version 1.6.1) and still exists in the new version, version 2.1, which I already use in my Java Swing programs.

I will attach a screenshot of the issue attached to this message.

Thank you very much for this great Java Swing look and feel library.

Sincerely,

Adrian Kiess

DevCharly commented 2 years ago

That's probably because the text is painted using bold font, but layout computing is done with regular font. I'll have a look...

adriankiess commented 2 years ago

Thank you very much for your answer. The FlatLaf Light look and feel does not have this issue, but it appears most of the other look and feels. Yes, it appears in the FlatLaf Light look, the text of the default JButton is not rendered in bold. I use all of the FlatLaf look and feels, including the flatlaf-intellij-themes in my applications, the user can choose which look and feel to use. Many greetings from Germany, Adrian Kiess

DevCharly commented 2 years ago

Fixed in main branch. Thanks.

adriankiess commented 2 years ago

Thank you very much! Sincerely, Adrian Kiess