Skip to content
Advertisement

How to make SWT button Text BOLD

I am creating a checkbox button with text in SWT.

JavaScript

In messages.properties, I have the value

JavaScript

How can i show the text(ie. Answer) of this button in BOLD?

Advertisement

Answer

You can convert the currently assigned font for the button to be bold using something like:

JavaScript

Note: You must call boldFont.dispose() when you are done with the font (such as when the dialog closes).

I’m not sure that all platforms support changing the button font. The above code works on macOS.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement