tags:

views:

449

answers:

1

Hello all,

I am having the following code snippet in my application screen to show a label text in some bigger and good font. It looks good to me. But i also want to make this font to "bold" as well. Currently it doesn't show in boldfont as well. Could someone guide me how can i provide the label field text with the same font but also with bold ??? (or) Please tell me how can i make the label text with any other bigger size(24) font with bold?

LabelField subTitleLabel = new LabelField ("My App Sub Title", LabelField.FIELD_LEFT);

    final FontFamily fontFamily[] = FontFamily.getFontFamilies();
    final Font font10 = fontFamily[1].getFont(FontFamily.CBTF_FONT, 24);
    subTitleLabel.setFont(font10);

    subTitleLabel.setMargin(25, 0, 0, 10);

    horEventFldManager.add(subTitleLabel);
+3  A: 

This assumes that subTitleLabel is already set to the font that you want. It is just resetting it to a Bold version of that font.

subTitleLabel.setFont(subTitleLabel.getFont().derive(Font.BOLD));
Fostah
It is perfect ! Thank you very much.