• Post Reply Bookmark Topic Watch Topic
  • New Topic

copy selected data from JTable's cell to clipboard

 
gayatri palle
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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.
------------------
 
Diana McHenry
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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:

 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!