How to center content of JTable Headers at Nimbus Look and Feel

MOD picture MOD · Oct 3, 2011 · Viewed 8.6k times · Source

How can i center the content of JTable Header which has a nimbus look and feel? I tried to use DefaultTableCellHeaderRenderer, but it look like this;

JTable Header with Nimbus Look and Feel

is there any way to make them all look like PARENT_ID column's and centered?

Answer

trashgod picture trashgod · Oct 3, 2011

This example shows one approach. By using the table header's DefaultTableCellRenderer, it minimizes the impact on the UI delegate's appearance.