File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes JTable Background in JDK 1.3.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable Background in JDK 1.3.0" Watch "JTable Background in JDK 1.3.0" New topic

JTable Background in JDK 1.3.0


Joined: Jun 01, 2001
Posts: 4
For the portions of the jtable that do NOT have rows in them, the background is by default grey, in JDK 1.3.0. However, in JDk 1.2.2 and earlier, you could set the background color, w/ setBackground(Color). This doesn't work in JDK 1.3.0. Does anybody know how to fix that?
Jagan Mohan Reddy

Joined: May 15, 2001
Posts: 18
I think you are using a scrollpane over the table.
The grey portion is not the table area but the view port area. so set the background for the view port.

the code for getting the background color is

I think this solves ur problem.

Jagan Mohan Reddy.
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
I agree. Here's the link:
subject: JTable Background in JDK 1.3.0
It's not a secret anymore!