craftleft.gif (3002 bytes)QuickTable
Home | API | Tutorial | Download | Support | Contact topblack.gif (108 bytes)


QuickTable User Cp  |  Register  |  Members  |  Search  |  Help
    |- QuickTable Discussion Forums > CellEditor/Renderer Post New Topic   Post A Reply
image cell printer friendly version
next newest post | next oldest post
Author Messages
Jinfang.Zhu{@}BISC.SIEMENS.COM.CN
Unregistered
Edit or delete this message Reply w/Quote
Posted Wednesday, December 31, 1969 @ 23:59:59  

there is String type field in my database. its value is a path of the graphic file.
the data in this table is shown in quicktalbe, I hope when I click the column corresponding this field, the graphic can be shown in anther form or other way to show it.
admin{@}quicktable.org
Unregistered
Edit or delete this message Reply w/Quote
Posted Wednesday, December 31, 1969 @ 23:59:59  

You have to implement your own cell renderer/editor to acheive this. Please refer to the documention of CellComponent for this.
The following example shows how to implement a cell reneder/editor for this. When the user tries to edit the cell , it shows the images & a small button nearby, clicking on the button it will show the File dialog, which can be used to select the file which the user wants to change to. I haven't tested the code yet. This is just to give a idea.

class ImageCellRenderer extends JLabel implements CellComponent
{
private String path ="":
public void setValue(Object value)
{
path = (String) value;
setIcon(new ImageIcon(path) );
//handle the case if null is passed
}
public Object getValue()
{
return getPath()
}
}

Post New Topic   Post A Reply Jump to:
Contact Us | QuickTable - A Java DBGrid | Privacy Policy All times are GMT -5 Hours.
Welcome to QuickTable Forums, Guest!  
Login
Username :
Password :
In order to fully utilize the abilities of this board, you are required to register as a member. Registration is free, and allows you to do lots of things including turning on or off certain features of this board. Register now!
Powered by CuteCast v2.0 BETA 2
Copyright © 2001-2003 ArtsCore Studios