thumnail and JTable
Hello all
In my database, I have a table of images (image file name with a blod field). I also have a JTable to display the name of these images. Now I need to display thumbnails for these images in this JTable.
My question is: do I have to create a thumbnail image for each image to show in the JTable (that means I need a new field in the image table) OR I can use these images as thumbnails.
Thanks
suhu
[438 byte] By [
suhua] at [2007-11-27 10:39:05]

> Hello all
>
> In my database, I have a table of images (image file
> name with a blod field). I also have a JTable to
> display the name of these images. Now I need to
> display thumbnails for these images in this JTable.
>
> My question is: do I have to create a thumbnail image
> for each image to show in the JTable (that means I
> need a new field in the image table) OR I can use
> these images as thumbnails.
>
> Thanks
> suhu
What you need to do is write a new TableCellRenderer to display the image.
You can then use the original images and just scale them on the fly...
Read through the JTable tutorial for information on writing custom renderers
http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#editrender