Originally posted by Maneesh Godbole:
You still need to define the Class for which the renderer needs to be used. So if you define the renderer for Image.class, the table model still returns the Object.class and so the renderer wont be picked up.
So the model definitely needs to be tweaked to return the proper class.
You are correct about the model needing to return the proper class.
I recommend that you have your model return
Icon.class or
ImageIcon.class, not Image.class. That way you don't have to define a renderer, as JTable
automatically provides one for you.
Of course, the table model must actually return instances of Icon or ImageIcon for the column. Looking at the original post in this
thread, ImageIcons are being returned with show2() and show3(), so no problem there.
[ January 16, 2008: Message edited by: Brian Cole ]