aspose file tools*
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

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 18113

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: 4522

Cross posted and answered before this was even posted here:

Noboru, please Be Forthright When Cross Posting To Other Sites.

luck, db
There are no new questions, but there may be new answers.
I agree. Here's the link:
subject: JTextArea
Similar Threads
Insertion in JTextArea
relayouting after setViewportView for JScrollPane
when should we use static modifier
Cut and Paste, what is the difference with ContentPane and a Panel?
Help about JTextArea in applet!