jQuery in Action, 3rd edition
The moose likes Beginning Java and the fly likes JTextArea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "JTextArea" Watch "JTextArea" New topic


Noboru Wataya

Joined: May 27, 2011
Posts: 1
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

Joined: Oct 14, 2005
Posts: 19728

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

Joined: May 03, 2008
Posts: 4996

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.

luck, db
There are no new questions, but there may be new answers.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: JTextArea
It's not a secret anymore!