Search code examples
javaimagejtablecell

How to Insert Image into Jtable by Netbean Builder


I designed 1 JTable by using Netbean Builder So how to create image to the table.
this is capture of code customizer and as u see there is no name for array row data and array column data.

enter image description here


Solution

  • You should simply be able to provide Icon or ImageIcon as the class type of given columns and JTable will render it for you

    Within the default table editor for NetBeans, you can set the column class type, simply make it Icon.class or ImageIcon.class

    Start by right clicking on your table in the design view and choosing "Customize Code"

    enter image description here

    In the editor, select "custom property" from the drop down box next to the code block you want to change...

    enter image description here

    Change the columns that require pictures to use javax.swing.Icon.class...

    enter image description here