You must create your own Model Table .
Find the following point:
If the programmer does not provide a table model object, JTable automatically creates an instance of DefaultTableModel.
And the following:
On the other hand, SimpleTableDemo automatically created a table model, it does not know that the # of Years column contains numbers (which usually should be right justified and have a certain format). He also does not know that a vegetarian column contains logical values ββthat can be represented by flags.
The design should be as follows:
JTable table = new JTable(new MyTableModel());
instead of JTable(Object[][] rowData, Object[] columnNames) or JTable(Vector rowData, Vector columnNames) . In this case, it uses the DefaultTableModel , which is not smart enough to display your booleans as ticks (flags).
It also has sample code that will help you achieve what you are trying to achieve.
source share