• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

captured text

 
Saras Thangaraju
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4363
2
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
windows has that functionality built-in. ctrl c is copy ctrl v is paste
 
Randall Twede
Ranch Hand
Posts: 4363
2
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i found an example in my textbook that should help.
private JTextArea display = new JTextArea;
private String scratchpad = "";
// if whatever
scratchpad = display.getSelectedText();
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic