• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

disabling windows paste for text components

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I changed it
 
Eric Hoskland
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic