Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Cut,Copy,Paste  RSS feed

 
Jennifer Sohl
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).]
 
Ben Wood
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!!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!