• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Regarding Copy and paste operation

 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Clipboard transfer is what you want.
Check out http://java.sun.com/j2se/1.5.0/docs/guide/swing/1.4/dnd.html
 
Sheriff
Posts: 22863
132
Eclipse IDE Spring TypeScript Quarkus Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I am a man of mystery. Mostly because of this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic