• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

selectable text -> copy to clpboard

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ulf, thank you for your response. Obvious now.
 
mooooooo ..... tiny ad ....
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic