• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Cut,Copy,Paste

 
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following is an example of how to copy and paste...

I have also noticed that the JTextComponent package has methods for cut, copy, and paste.
What is the difference between the two?
Why would I want to add all of the above code if I can just call the cut() method on my JTextField?
I'm a bit
Still new at this. Thanks in advance!!


[This message has been edited by Jennifer Sohl (edited September 10, 2001).]
 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just use the cut(), copy(), paste() provided by Java in a couple of my apps and have never had any problems with the method. I personally wouldn't bother using all that other code!
regards,
Ben.
 
Jennifer Sohl
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply! Now, since I know I can use the methods provided, I have another question. I have an application with numerous JTextFields. How do I tell it I want to paste the contents of the clipboard to a certain Field? I can call a paste method on all of the fields, but then the text goes into all of the fields.
I guess I need to know how to condition the paste method to put the copied text in a certain place.
Any suggestions?
Thanks in advance!!!
 
Uh oh, we're definitely being carded. Here, show him this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
    Bookmark Topic Watch Topic
  • New Topic