Closed mariusflorinelcristian closed 4 months ago
thanks for reporting. Fixed in latest 3.5-SNAPSHOT
: https://github.com/JFormDesigner/
...there is no possibility to define the border, hover and pressed colors for a selected JToggleButton.
Implemented in latest 3.5-SNAPSHOT
.
New properties are (for JButton and JToggleButton):
Button.pressedBorderColor
Button.selectedBorderColor
Button.disabledSelectedBorderColor
Button.focusedSelectedBorderColor
Button.hoverSelectedBorderColor
Button.pressedSelectedBorderColor
Button.default.pressedBorderColor
Thank you Charly for fixing the selected JToggleButton foreground when it has an HTML text.
I've also tested the new properties for JButton and JToggleButton in 3.5.1:
Button.pressedBorderColor
Button.selectedBorderColor
Button.disabledSelectedBorderColor
Button.focusedSelectedBorderColor
Button.hoverSelectedBorderColor
Button.pressedSelectedBorderColor
Button.default.pressedBorderColor
These properties are really useful for selecting the border color. Foreground/background JToggleButton properties that are available for the Button (e.g. ToggleButton.disabled[focused|hover|pressed]selectedForeground[Background]) are not available for the JToggleButton.
Thank you very much for your work.
... Foreground/background JToggleButton properties that are available for the Button (e.g. ToggleButton.disabled[focused|hover|pressed]selectedForeground[Background]) are not available for the JToggleButton.
JToggleButton uses same properties as JButton for button border properties. See https://www.formdev.com/flatlaf/components/borders/#flatbuttonborder
If you really need separate border properties for JToggleButton, you could create a subclass of FlatButtonBorder
(e.g. MyToggleButtonBorder
), update color related fields in constructor and then register that class as JToggleButton border.
E.g. ToggleButton.border = somepackage.MyToggleButtonBorder
in FlatLaf properties,
or UIManager.put( "ToggleButton.border", new somepackage.MyToggleButtonBorder() )
in code.
Hi, It seems that for a selected JToggleButton foreground is not applied if the button has HTML text. This could be the same problem as the one reported in https://github.com/JFormDesigner/FlatLaf/issues/756. I've tested with the latest version (3.4.1) like below:
I've expected to see all buttons with GREEN foreground, if they are selected, but only the normal button looks as expected. Same happens if the properties are set in the properties file.
Also, maybe the subject for another ticket, there is no possibility to define the border, hover and pressed colors for a selected JToggleButton.
Thanks, Cristi