This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes General Computing and the fly likes captured text Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » General Computing
Bookmark "captured text" Watch "captured text" New topic
Author

captured text

Saras Thangaraju
Greenhorn

Joined: Jan 30, 2004
Posts: 6
hi everyone....i am not too sure about this but i need to get some infor so i could work on it...any help would be gret
currently i have worked on to capture highlighted text from any desktop application using short-cuts keys on keybrd and translating the highlighted text to open another appliction....
i need to do this on the mouse cursor...how do i capture the word that i have highlighted, so that its displayed on my application when i open it using right click...so i have to know the co-ordinates of the highlighted rectangle?
help
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

windows has that functionality built-in. ctrl c is copy ctrl v is paste


SCJP
Visit my download page
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

i found an example in my textbook that should help.
private JTextArea display = new JTextArea;
private String scratchpad = "";
// if whatever
scratchpad = display.getSelectedText();
 
GeeCON Prague 2014
 
subject: captured text