More input components
It's time to continue with our trip. Vaadin has several built-in input components (or fields as they implement directly or indirectly the Field
interface). All these components extend from AbstractField
or AbstractSelect
. Let's take a look at some of them.
Text area
TextArea
is quite similar to TextField
. The difference is that the user can enter multiline texts. Take a look at this sample application:
public class TextareaUI extends UI implements ValueChangeListener { @Override protected void init(VaadinRequest request) { // our TextArea component TextArea textArea = new TextArea( "Enter some multi-lined text and press TAB:"); textArea.addValueChangeListener(this); textArea.setImmediate(true); VerticalLayout layout = new VerticalLayout(); layout.addComponent(textArea); setContent(layout); } @Override public void valueChange(ValueChangeEvent event) { String userText = event.getProperty().getValue() .toString...