• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

selectable text -> copy to clpboard

 
glen croteau
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using graphics.drawChars to write static text to a signed applet. I would like to be able to select this text and copy it to the system clipboard. I have the copy to clipboard part working. However I need to find a way to allow the user to select the text which I will add to the StringBuffer and then transfer to the clipboard.

Advice please.
Thanks!
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Once it's drawn, the JRE has no idea that it was text to begin with, so unless you keep track of all text that is drawn and can retrieve it later during the "select" operation, this would be difficult to achieve (barring the use of OCR).

You'd also need to keep track of where on the Graphics which text is drawn (x/y coordinates), so that you can associate the user's selection with the text.
 
glen croteau
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf, thank you for your response. Obvious now.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic