LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-27-2009, 03:28 PM   #1
manolakis
Member
 
Registered: Nov 2006
Distribution: xubuntu
Posts: 464

Rep: Reputation: 37
JTextArea actionPerformed


Hi there,

I want to add an action listener on a JTextArea, with an actionPerform method. Basically what I want to do is to get the text from the text area whenever the enter button is clicked.
Any ideas?

Thank you.
 
Old 11-27-2009, 04:50 PM   #2
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
JTextArea is multi-line, right?

In that case, shouldn't Enter be used to start a new line rather than as an event?

If a one-line entry is what you want, use JTextField. I think it uses an ActionListener, it was a long time since I used Java Swing.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
JTextArea update manolakis Programming 3 04-15-2009 11:48 AM
Java: JTextArea and Syntax Highlighting? Mega Man X Programming 8 02-23-2006 10:31 AM
JTextArea Question for Java Programmers Diederick Programming 1 09-16-2005 08:25 PM
java swing JTextArea gauravbagga Programming 1 05-23-2005 04:34 AM
JTextArea and autoscroll mcshen Programming 1 03-20-2004 06:04 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration