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]
# 1

I believe that you have to create a new thumbnail for each image (anyone, please correct if wrong).

petes1234a at 2007-7-28 18:58:51 > top of Java-index,Java Essentials,New To Java...
# 2

> 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

c0demonk3ya at 2007-7-28 18:58:51 > top of Java-index,Java Essentials,New To Java...