By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,541 Members | 1,109 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,541 IT Pros & Developers. It's quick & easy.

Change the background of a JTable?

P: n/a
I'm working on making my chat applet a little more portable.
Specifically I want to set it up so the colors of the various components
can be changed via param tags. The only problem is, I can't figure out
how to change the background of a JTable I have to display the users
that are connected...

If you do:

table.setBackground(Color.whatever);

it changes the color of the elements rather than the rest of the table.

If you change the color of the panel it's sitting in it doesn't work either.

To illustrate, I've made a test applet to show you what I mean at:

http://evilgeeks.ca/EGIMP/remotetest/

The green is the panel behind the table. The blue is where I did
'table.setBackground(Color.blue);'.

What I need to know, is whether the gray part of the table can be changed.

Any help is appreciated greatly.
Thanks,
Joseph Smith

Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.