This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Pasting image in JTable cells Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Pasting image in JTable cells" Watch "Pasting image in JTable cells" New topic
Author

Pasting image in JTable cells

Shaik Muhammad
Ranch Hand

Joined: Jul 16, 2008
Posts: 36
I am unable to paste an image in the table cells. i am using cell rendered still am not getting the image.
Please look at my code



Please help

[edit]Add Code Tags. CR[/edit]
[ September 06, 2008: Message edited by: Campbell Ritchie ]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38033
    
  22
Please find the Code Button; I have edited your post so you can see how much easier it is to read.
This sounds a specifically Swing-related issue, so I shall move you to the Swing forum.
Brian Cole
Author
Ranch Hand

Joined: Sep 20, 2005
Posts: 862
First, you shouldn't need to use a custom renderer
to show an image. The functionality is built-in.
All you need to do is return Icon.class (or
ImageIcon.class, either works) from your table
model's getColumnClass() method.

Second, what do you mean by pasting an image? If you
mean pasting from the clipboard (a la Ctrl-V) then it
will take a little work. It would probably be easiest
to create a class to pass to setTransferHandler().


bitguru blog
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535

Geek Images
 
 
subject: Pasting image in JTable cells
 
Similar Threads
Tabbing between cells in a JTable
JTable
Setting renderers on JTable
JTable
problem in JTable