Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTextArea

 
Noboru Wataya
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am trying to create an application that has several JTextAreas. It also has a JMenuBar with Cut/Copy/Paste options. The problem is I do not know how to tell the paste menu action listener which JTextArea has the cursor so that it knows which JTextArea to paste the clipboard contents into. Can anybody help with this? Thanks in advance.

 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you say "has the cursor", the Java term for that is "the focus". So you might benefit from reading How to Use the Focus Subsystem and How to Write a Focus Listener.
 
Darryl Burke
Bartender
Posts: 5126
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cross posted and answered before this was even posted here: http://www.java-forums.org/awt-swing/44650-jtextarea-paste-function.html

Noboru, please Be Forthright When Cross Posting To Other Sites.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic