Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Pasting image in JTable cells

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • 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: 69882
278
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator

Geek Images
 
Anything worth doing well is worth doing poorly first. Just look at this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic