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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "JTextArea" Watch "JTextArea" New topic
Author

JTextArea

Noboru Wataya
Greenhorn

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
Bartender

Joined: Oct 14, 2005
Posts: 18651
    
    8

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

Joined: May 03, 2008
Posts: 4638
    
    5

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 agree. Here's the link: http://aspose.com/file-tools
 
subject: JTextArea