How to change the Font of a SpanLabel in Codename One?

Why can't I set the font of a SpanLabel of Codename One?

SpanLabel title = new SpanLabel("SpanLabel");
title.getAllStyles().setFont(Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_LARGE));

Doesn't work.

Upvotes: 3

Views: 506

Answers (1)

tizbn
tizbn

Reputation: 1907

SpanLabel title = new SpanLabel("SpanLabel");
        **title.getTextAllStyles()**.setFont(Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_LARGE));

To change style of spanlabel getTextAllStyle method should be called as shown in above code

Upvotes: 5

Related Questions