JTable titles problem

Hi All,

my table include only one row with four columns.

when my table appear all my titles allign to the left side of each column.

i want to force it to show in the center of each column how can i do it?

TIA

here is my part code:

String[] columnNames ={"Diagnostics Tree",

"Last Result",

"# Pass",

"# Fail",

""};

Object[][] data ={};

if (jTable ==null){

jTable =new JTable(data,columnNames);

jTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

jTable.getTableHeader().setReorderingAllowed(false );

}

return jTable;

[1074 byte] By [Gabia] at [2007-11-27 8:57:21]
# 1
Find a soloution://ALLIGN ALL THE TITLES TO CENTERDefaultTableCellRenderer TableRenderer=(DefaultTableCellRenderer)jTable.getTableHeader().getDefaultRenderer();TableRenderer.setHorizontalAlignment(JLabel.CENTER);
Gabia at 2007-7-12 21:21:47 > top of Java-index,Desktop,Core GUI APIs...