Results 1 to 7 of 7
  1. #1
    andre1011 is offline Member
    Join Date
    Feb 2009
    Location
    Sacramento CA
    Posts
    17
    Rep Power
    0

    Default user input with JTextArea

    Could any one show me an example of how I can get user input via the keyboard within a JTextArea? Is this possible?

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    If you haven't looked here, this is where I'd start. Much luck.

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  4. #4
    andre1011 is offline Member
    Join Date
    Feb 2009
    Location
    Sacramento CA
    Posts
    17
    Rep Power
    0

    Default

    I have a menu which is displayed inside of a JTextArea
    the user must enter an option
    I need to get back what the user entered
    the problem is how do I get back what the user typed inside of the JTextArea

  5. #5
    xcallmejudasx's Avatar
    xcallmejudasx is offline Senior Member
    Join Date
    Oct 2008
    Location
    Houston, TX & Flint, MI
    Posts
    609
    Rep Power
    6

    Default

    There's a method called getText you can call that will return what is currently inside the TextArea.

    *edit*
    Using JTextField you can do this. I misread your post but JTextArea should have something very similar if not the same
    Liberty has never come from the government.
    Liberty has always come from the subjects of government.
    The history of liberty is the history of resistance.
    The history of liberty is a history of the limitation of governmental power, not the increase of it.

  6. #6
    Join Date
    Feb 2009
    Posts
    2
    Rep Power
    0

    Default

    thanks
    buddy

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. how to get input from User
    By Alvaro in forum New To Java
    Replies: 7
    Last Post: 01-15-2010, 11:02 PM
  2. User input for frame
    By JavaStarter in forum AWT / Swing
    Replies: 7
    Last Post: 04-03-2009, 06:11 AM
  3. User input- Pop Up Box
    By dedachi in forum AWT / Swing
    Replies: 3
    Last Post: 03-23-2009, 04:47 AM
  4. loop when there is no user-input
    By becky in forum New To Java
    Replies: 12
    Last Post: 02-02-2009, 10:02 PM
  5. cant take input from user
    By new_1 in forum New To Java
    Replies: 6
    Last Post: 12-25-2007, 07:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •