Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Regarding Copy and paste operation  RSS feed

 
yekkala krishna
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am new to swing appliation.In our application i need to add new functionality to Edit Menu with Copy and Paste operations.
Can any body help me how to develop this?If you have any application or logic regarding this please foward it to me.



Regards,
Rama Krishna.Y
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you know how to create a menu with items? If not, please read How to use Menus.

Ok, now you know how to create a menu with items Now let's get to the actions behind the menu items. The first thing we need is a definition of what you want to copy and paste. Is it text? If so, where does it come from? JTextComponent, the base class of (nearly) all Swing text components, has methods copy(), cut() and paste() that you can call.
 
Rob Camick
Ranch Hand
Posts: 2752
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the section from the Swing tutorial on Text Component Features. for a working example. It shows you how to use the default Cut, Copy, Paste Actions that come with the editor kit.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!