You are getting this behavior because you are placing a two dimensional Object array into your data location at (m, n)
data[m][n] = new Object[][]{
{
personel.getPersonelAdSoyad(),
personel.getUnvanID().getUnvanAdi()
}
};
If you want to have a two dimensional array at this location,
to get the behavior you want, you will need to define a custom renderer. First I would recommend that you encapsulate this raw 2d array into a class you have designed to contain it, and then define a renderer for that class.
import java.awt.Component;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellRenderer;
public class CustomTableCellRenderer implements TableCellRenderer {
private static final TableCellRenderer defaultRenderer = new DefaultTableCellRenderer();
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
Component renderedObject = null;
if(value instanceof CustomClass){
renderedObject = new JLabel();
// put your customized rendering code here.
} else {
renderedObject = defaultRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
}
return renderedObject;
}
}
After defining your renderer, you can set it on the table with:
jTable1.setDefaultRenderer(CustomClass.class, customRenderer);