Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

changing the column headers in a java JTable?

weird JTable behavior!

so when ever i want to change the column headers i use:

jTable.getColumnModel().getColumn(0).setHeaderValue("new header string blahhh");

but when i run it, the header only changes to the new value when i mouse over the header...

i have NO mouse over events anywhere at all

any one know what's going on??

i dont know if it matters but i used the netbeans GUI editor to create it

thanks!

Update:

yahoo cut me off it should be

...getColumn(0).setHeaderValue("header String blahhh")

1 Answer

Relevance
  • Anonymous
    7 years ago

    use

    table.getTableHeader().setBackground(Color.orange)

    method

Still have questions? Get your answers by asking now.