• 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

copy selected data from JTable's cell to clipboard

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have an uneditable JTable, in which the cells are rendered either with JTExtField or JTextArea. User needs ability to select data from the cell by mouse drag and copy the selected data to the clipboard. Unable to get the JTable to allow to select data from the cell and then copy to the clipboard. Would appreciate any help on this.
------------------
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is an old post, but I've been dealing with the same thing and thought I'd show what I've done thusfar. This solution works most of the time, but gets a little flaky when a custom renderer is used.

Does anyone know a foolproof way to harness data from a particular cell, as formatted by the appropriate renderer? Some of my columns store calendars, and I need to get the pretty mm/dd/yyyy output instead of the book Calendar.toString() prints out.

Anyway, here's what I've got:

 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
I love a good mentalist. And so does this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic