A JTextArea gives the user the capability of entering long text. This example responds immediately to all text changes. It is more common to use a button in association with a text area so that the application responds only after the user has completed text entry.