How to add an image to JTable

advertisements

I want to add image in JTable cell?

I have tried the image icon but it's written String in place of the image class

is there any way to do this thing?


you can do that particular thing via overriding following method in table model

    DefaultTableModel dTable= new DefaultTableModel(0, 0)
    {
        public Class getColumnClass(int column)
        {
            return getValueAt(0, column).getClass();
        };
    };