Results 1 to 2 of 2

Thread: JTextArea for input text from the user

  1. #1
    Join Date
    Mar 2010
    Posts
    3

    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

  2. #2
    Join Date
    Jan 2008
    Posts
    1,521

    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.

Similar Threads

  1. Input text value problem
    By NetworkeR in forum Software Development
    Replies: 3
    Last Post: 28-11-2009, 11:56 AM
  2. Check multiple text box input
    By GlassFish in forum Software Development
    Replies: 2
    Last Post: 24-11-2009, 01:23 PM
  3. Setting input text values
    By Solaris in forum Software Development
    Replies: 3
    Last Post: 23-11-2009, 02:42 PM
  4. Bolding text in a JTextArea
    By Kieran Blenkarne in forum Software Development
    Replies: 3
    Last Post: 09-11-2009, 01:10 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,670,521.25161 seconds with 17 queries