wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes How to disable copy and paste in a JTextField Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to disable copy and paste in a JTextField " Watch "How to disable copy and paste in a JTextField " New topic
Author

How to disable copy and paste in a JTextField

Jeff Chang
Greenhorn

Joined: Aug 23, 2001
Posts: 23
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

Joined: Dec 06, 2000
Posts: 148
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.


- Vinod<br />-------<br />SCJP2
Jeff Chang
Greenhorn

Joined: Aug 23, 2001
Posts: 23
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
 
subject: How to disable copy and paste in a JTextField
 
Similar Threads
Implementation of Copy/Paste in a component which is similar to textfield
JTextField - Restrict length
Disable Copy in JEditorPane
How to disable Japnese Character Input in JTextField
Copy to RAM memory