TextField is one of the most common user
interface components and is highly versatile. It supports both
single- and multi-line editing, password input, and buffering.
The following example creates two simple text fields: a single-line
and a multi-line TextField.
/* Add a single-line text field. */
TextField subject = new TextField("Subject");
subject.setColumns(40);
main.addComponent(subject);
/* Add a multi-line text field. */
TextField message = new TextField("Message");
message.setRows(7);
message.setColumns(40);
main.addComponent(message);
Notice how font size affects the width of the text fields even though the width was set with the same number of columns. This is a feature of HTML.