48.1 Overview

Text class derives from Area class and creates widgets that display one or more lines of text, pretty similar to what widgets of Label class do. A difference is that Text class supports multiple lines of text as well as frames around the text and widgets created by Text class are resizable whereas Label class creates non-sizeable widgets. Like Label class, Text class also supports the underscore character in its text to define a keyboard shortcut.

Please note that Text class supports neither automatic word wrapping nor text formatting. If you want to have these features, you have to use Textview class instead. See Textview class for details.

Here is an example of how to use the <text> tag in XML:

 
<text>Hello World</text>


Show TOC