Win a copy of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests this week in the OCP 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

keyboard short cuts in java...

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
does anyone know how to emulate a keyboard short cut in java? for example, run the same command as ctrl-c when a specific event it triggered from my java code??? it's currently running from an applet. i want people to NOT directly use ctrl-c but to click on something and have that fire the ctrl-c for them.
 
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
did you have specific key combos you were trying to emulate or did you want it open to anything? Are you trying to (as per your example) copy stuff to the system clipboard? Or is just for use inside your java code?
 
jorge zapata
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok here is the deal, your questions are definitely good. i shall explain more...
i am in a jdbtable implemented by a borland dataSet (that's only background information). if i highlight a bunch of rows and do ctrl-c it will copy the data and i can do a ctrl-v into excel or anyother application.
now, our users are not very keyboard short cut savy at all.
i have set up a menu when they right click to say copy (which is a copy field) to grab data in the cell and put it into the clip board for later use.
now i want to add a copy row and copy rows selected. i am trying to copy all the data in all the rows selected and put them in the clipboard. the ctrl-c works, now if i could call the ctrl-c function from my code that would be all i have to do.
if i cannot do that, i will have to write code to figure out what rows are selected and grab the columns etc... and put that in the clipboard. and that is what i am trying to avoid to do. all i want to do is use the existing ctrl-c from a java action performed.
thanks you in advance,
jz
 
I'm THIS CLOSE to ruling the world! Right after reading this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic