Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Copying cell value from JTable

 
Balasubramaniam Muthusamy
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everyone,
I have a JTable with set of rows. When i click on any row just i need to copy the second cell value of that row to clipboard.. Could anyone please guide me?

Thanks
Bala
 
Rob Camick
Ranch Hand
Posts: 2584
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is your exact problem?

a) do you know how to copy a String to the clipboard?
b) do you know how to get data from a cell in the table?
c) do you know how to write a MouseListener

Start by solving "a" first, then "b", and then "c". I'm sure you can find examples on the web on how to use the clipboard. You can start by taking a look at the Clipboard API.

Why would clicking on a cause text to be copied to the clipboard. Does this mean that every time you click on a cell the text is copied? Or are you going to have a popup menu with some Actions that allow you to copy text from the cell.

 
Balasubramaniam Muthusamy
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much for your response.. i am able to copy now
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic