Style of Labels and radioButtons label

Hello,
I made a simple application to try multiple microej widgets and their style using stylesheet.
When i try to add an editable style to my labels, it also applied to the labels of my radio buttons.
How can i make it so my style only apply to my labels and not to the labels of my radio buttons.
Thank you.

Hi @flardy,

Instead of applying a style to every Label you can apply styles on specific instances with custom classes you can create.

Using the API of addClassSelector API of StyleWidget [1], you can specify your custom class. Then using the addRule API of Stylesheet [2], you can apply a custom style to your label.

You can also look at the Demo widget [3] for a complete example that is using styled widgets.

Regards,
Gaƫtan

[1] https://developer.microej.com/javadoc/microej_4.1/addons/ej/widget/StyledWidget.html#addClassSelector-java.lang.String-
[2] https://developer.microej.com/javadoc/microej_4.1/addons/ej/style/Stylesheet.html#addRule-ej.style.Selector-ej.style.Style-
[3] https://github.com/MicroEJ/Demo-Widget

Hello gaetan,
Thank you for your reply, this is exactly what i needed.
It works as intended now.