This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Need to restrict ctrl+c, ctrl+v, ctrl+x Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Need to restrict ctrl+c, ctrl+v, ctrl+x" Watch "Need to restrict ctrl+c, ctrl+v, ctrl+x" New topic
Author

Need to restrict ctrl+c, ctrl+v, ctrl+x

Subbarao Kondabala
Greenhorn

Joined: May 17, 2005
Posts: 27
Hi,

In my text field I want to restrict ctrl+c, ctrl+v, ctrl+x. How can I do this in swings.

Please help me

Thanks in advance

Subbarao Kondabala


Thanks and Regards,
Subbarao Kondabala
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10167
    
    8

A text field can be disabled. Swing (not swings) provides the capability to sense keyboard events.
Putting these two facts together, how do you think this particular problem should be approached?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> In my text field I want to restrict ctrl+c, ctrl+v, ctrl+x. How can I do this in swings.

the simple way is to override cut() copy() paste(), to do nothing
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2152
    
    7
Remove the Key Bindings from the InputMap.

Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10167
    
    8

Michael Dunn wrote:
the simple way is to override cut() copy() paste(), to do nothing


I was not even aware of these methods!!! Guess I need to go back to school. Doh!
Subbarao Kondabala
Greenhorn

Joined: May 17, 2005
Posts: 27
Thanks so much Michael

It got worked

Once again thank you so much


Subbarao kondabala

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need to restrict ctrl+c, ctrl+v, ctrl+x
 
Similar Threads
How to enable CTRL+C to perform action instead of coping to clipboard?
WA #1.....word association
pet peeves (computer related)
JMenuItems tricks for displaying short cut text
regarding jq+ code