JTextArea for input text from the user
Hi,
I try to create a JTextArea that the user enters text to it, and I would like to use this text, when the user presses a button.
textArea.getText() gives me the original text, its like it is not updated even though in the gui, the text the user entered is shown.
How can I get the inserted text?
Thanks a lot,
Liat
Re: JTextArea for input text from the user
You have to use Text Areas in the following ways.
The JTextArea class provides a component that displays multiple lines of text and optionally allows the user to edit the text. If you need to obtain only one line of input from the user, you should use a text field. If you want the text area to display its text using multiple fonts or other styles, you should use an editor pane or text pane. If the displayed text has a limited length and is never edited by the user, use a label.