Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

disabling windows paste for text components

 
Eric Hoskland
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18094
48
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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!
 
Eric Hoskland
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I changed it
 
Eric Hoskland
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2591
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think, you can use

and so on, this should work.
HTH,
- Manish
 
Eric Hoskland
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not using swing and I think setAccelerator is only for a swing menu item.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18094
48
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic