java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

java

israr
i want to display image in jTable from database .
i am using this for defaultTableModel .like this
this is globel veriable defined here,
byte[] image;
public ImageIcon getImage(){
return new ImageIcon(new ImageIcon(image).getImage().getScaledInstance(100,100, java.awt.SCALE_SMOOTH)):
}
action performd button here
DefaultTableModel dt=new DefaultTableModel();
dt.addColumn("ID");
dt.addColumn("Image");
query And conection manage here,
then while(rs.next()){
String Id=rs.getString(1);
image=rs.getBytes(2);
Object[] obj={id,image};
addRow(obj);
tablename.setModel(dt);

but not working can any one tell me the solution???? please thanx in advance..
Loading...