Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Override Windows Ctrl-C

843806Sep 14 2007 — edited Sep 26 2007
Hello, I am looking for a solution for disabling automatic copy action from Windows.

Basically, I have a JTree with Objects (doesn't matter what they are) which I would like to be able to copy from one node to another.
I have registered accelerator to a JMenuItem as Ctrl+C.
The problem is, when I press this keys windows automatically copies node's text to clipboard, thus disabling my own listener.
If I switch accelerator to ctrl+q for example, it works prefectly and adds whole object to clipboad thus allowning me to paste it into another node.
As i also have a JTextArea, i tried to disable/not initilize it, as I read here that it is only Component that utilizes this shorcut, but it doesn't help.
If i have focus on JMenuBar, the copying works (with ctrl+c).
And it is not a problem with focus on a JTree,because it works well with different shorcut.
Is there any way to disable it? Or maybe switch it off for JTree?
Thanks for any replies.

Edited by: mruk on Sep 14, 2007 4:19 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 24 2007
Added on Sep 14 2007
3 comments
363 views