This is my table:
I like that 61
and 29
and 2013/09/20
be in the middle of cell, Not in the left side!
How can do it?
This is my table:
I like that 61
and 29
and 2013/09/20
be in the middle of cell, Not in the left side!
How can do it?
You can do this, which sets the horizontal alignment for each column by overriding the renderer.
DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
renderer.setHorizontalAlignment(JLabel.CENTER);
for(int i = 0; i < columnCount; i++){
table.getColumnModel().getColumn(i).setCellRenderer(render);
}