File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes disabling windows paste for text components Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "disabling windows paste for text components" Watch "disabling windows paste for text components" New topic
Author

disabling windows paste for text components

Eric Hoskland
Greenhorn

Joined: Oct 12, 2000
Posts: 29
I've made a Java text component that has stardard menu selection items cut, copy, paste, etc. Now I've connected each one to it's windows default ctrl <KEY> so like
CTRL C = copy
CTRL V = paste
CTRL X = cut
The problem I've ran into is that I want to make this compatible with all operating systems. Does anyone know a good way to do this?
The way I have it setup right now is that I emulated the clipboard operations. So when a CTRL V occurs I just go in and manually perform the paste myself. The problem with this is that on a Windows system you get the CTRL V that Windows uses and then the Paste that I wrote both pasting which leads to a double paste.
Any suggestions?
I was thinking if there was a way to disable Windows Text actions so it only uses my CTRL V.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16054
    
  21

"morphean"
Welcome to the JavaRanch! We don't have many rules here, but we do have a Naming Policy in order to maintain a more professional atmosphere. You can find out more about it here. Please adjust your display name accordingly. Thanks!


Customer surveys are for companies who didn't pay proper attention to begin with.
Eric Hoskland
Greenhorn

Joined: Oct 12, 2000
Posts: 29
I changed it
Eric Hoskland
Greenhorn

Joined: Oct 12, 2000
Posts: 29
Basically does anyone know a good way to tie CTRL V, CTRL X, and CTRL C to paste, cut, and copy in both linux and windows. Windows doesn't require any programming to do this but linux does since it uses the shift->delete scheme instead and as I said before if I manually setup CTRL V to paste then I get double pastes in windows.
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

I think, you can use

and so on, this should work.
HTH,
- Manish
Eric Hoskland
Greenhorn

Joined: Oct 12, 2000
Posts: 29
I'm not using swing and I think setAccelerator is only for a swing menu item.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16054
    
  21

You really oughta ask in the AWT/Swing/JFC forum, since that's more their specialty and not really tied to applets.
However it's really better if you attempt to work within the PLAF framework rather than atempting to enforce Windows keysettings on everyone.
One of the biggest irritants X/Linux has over MS-Windows for me is that it's already got 2 mostly mutually-foreign cut-and-paste facilities running even before you try and add your own.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: disabling windows paste for text components