File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to disable copy and paste in a JTextField

 
Jeff Chang
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I want to disable the copy and paste in a JTextField. How to do this because these functionalities are default. Thanks for any advice.
Jeff
 
Vinod Venugopal
Ranch Hand
Posts: 148
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Du have any further specs b'cos obviously making setEnabled(false) would do?
Or you could use your own Document manager to disable copy paste actions.
 
Jeff Chang
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works now.
I overrided the copy() and paste() methods such as:
{
....
public void copy() {}
public void paste() {}
}
Jeff
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic