Forums Register Login

JTable + background colour

+Pie Number of slices to send: Send
I am using JTable to display a list of records that are inserted and removed at run time. I have no way of knowing how many will be in there at any given time.
I have set the background colour to white which is fine when there are records in the table. However, when there are say only 2 records in the table the remainging space of the table is the default grey. Is there anyway I can make the empty part of the table white as well or does the background property only relate to records in the table?
Thank you
David
+Pie Number of slices to send: Send
Without seeing the code I can only guess, but most likely you have put your JTable instance in a "JScrollPane" to manage the scrolling. Just set the background color of the JScrollPane to white as well.
look! it's a bird! it's a plane! It's .... a teeny tiny ad
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1033 times.
Similar Threads
JTable problem.
Images in a JTable
Changing Colour of JPanel That has JTable
My JTable is not refreshing.
Disabling the JTable
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 14:41:10.