• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 168
  • Last Modified:

Copy, Cut, Paste, Select All

I have a text editor that uses a JTextArea that I've created.  I have a menu bar and a toolbar.  What do I need to call to use the copy/cut/page/select all features?

Obviously I can press CTRL+A to select all the text, but I cannot press my toolbar button and simulate that.

Any help will be appreciated!

Thanks
0
jcbergman
Asked:
jcbergman
1 Solution
 
JavatmCommented:
Hi;

Its quite easy you just have to call cut(), copy(), paste(), selectAll(); methods its already built-in in Java.
You may also wanna see my donated codes for an example :

http://java.ittoolbox.com/code/d.asp?d=2922&a=s

Hope that helps . . .
Javatm

0
 
objectsCommented:
Use the text areas getActions() method to get the actions defined for it (such as cut,copy,paste) and add them to your toolbar:

Action[] actions = textarea.getActions();
for (int i=0; i<actions.length; i++)
{
    toolbar.add(actions[i]);
}
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now