This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

disabling windows paste for text components

 
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.
 
Bartender
Posts: 21767
148
Android Eclipse IDE Tomcat Server Redhat Java 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.
 
Ranch Hand
Posts: 2596
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
Bartender
Posts: 21767
148
Android Eclipse IDE Tomcat Server Redhat Java 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.
 
If you settle for what they are giving you, you deserve what you get. Fight for this tiny ad!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!