Search code examples
javaswingjtablenimbusjtableheader

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


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?


Solution

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