Label

This control is used to display static text or a marquee. The label in TotalCross can also display multiple lines of text, separated by the character.

Examples

This is the simplest example for label.

Label shape

Modify the shape of the component.

Behind the Class

Attributes

Type

Name

Description

int

Align

Sets the text align as LEFT, RIGHT, CENTER and FILL(justified)

boolean

autoSplit

Set to true to let the label split its text based on the width every time its width changes

Methods

Type

Name

Description

Constructor

Label( )

Creates an empty label, using FILL as the preferred width

Constructor

Label(String text)

Creates a label displaying the given text (that may be changed at runtime) using left alignment. Supports inverted text, multiple lines and is scrollable by default

Constructor

Label(String text, int align)

Like the above, but you can also set the horizontal alignment using one of the constants LEFT, CENTER, RIGHT, or FILL (justified)

void

setInvert( )

Inverts the back and fore colors

void

setHighlighted( )

Highlights the text by painting the text in all directions with a brighter color, then centered, with the foreground color.

void

setHighlightedColor( )

Sets the color used when highlighting is on

void

set3d(boolean on)

Draws the label with a 3d effect

References

Last updated

Was this helpful?