Win a copy of Fixing your Scrum this week in the Agile forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Pasting image in JTable cells

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Marshal
Posts: 73746
332
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Author
Posts: 974
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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().
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Geek Images
 
It sure was nice of your sister to lend us her car. Let's show our appreciation by sharing this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic