Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

showing image in jtable..problem of update?

818772Oct 2 2011 — edited Feb 15 2013
Dear all,
I need your help.
I have a list of object, object properties are a name (string) and a path (string).
In my swing jtable I need to show string and an image, that is read from path.
So I iterate list and for each iteration I do
                //get name
                String csName = ...
                //get array of byte from path
                byte[] cImg = csFullFile.getBytes();
                
 
                Icon icon = new ImageIcon(cImg);
                
                Object rowData[] = new Object[]{name, icon};
                //add row
                dtm.addRow(rowData);
What happens it that list is populated with correct number of rows...property name is shown but it's not shown image.
I think there is some problem with update of cell or layout...could you help me?
What code I've to run to show image in the jtable?

Thanks,
Regards
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 15 2013
Added on Oct 2 2011
4 comments
1,165 views