• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Copy & Paste from a JEditorPane

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi fellow programmers,
I'm trying to figure if there is an easy way to add copy & paste
with the system clipboard to my Java application, more concrete to a JEditorFrame in a JInternalFrame?
Typically users would copy text written in Word and paste it into my application for ease. From what I've read it's not possible to get simple markup along (like bold, italics etc), I don't suppose this have changed? (the JEditorFrame is used for HTML).
I'm grateful for all help and hints.
Thomas
 
Thomas Hansen
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found a solution to this problem which works well with my JEditorPane and that is using these actions:
cut-to-clipboard
copy-to-clipboard
paste-from-clipboard
Which is among the 83 actions I get when I asked my JEditorPane which actions it supported when I had contenttype set to "text/html".
A more general solution would be better so if anyone knows of another way, please speak out.
More details are available if someone needs it.
Regards,
Thomas
 
Dinner will be steamed monkey heads with a side of tiny ads.
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic