JTable is gray, I want it to be transparent

A

Aaron Fude

Hi,

I have a JTable and I set setOpaque(false) on it, on the JScrollPane
it's in, and on the labels that do the rendering. But the table is
still not showing the color of the JPanel that the JScrollPane is in.
Instead, it's gray. Am I making some common mistake here?

Many thanks in advance!

Aaron
 
R

RedGrittyBrick

Aaron said:
Hi,

I have a JTable and I set setOpaque(false) on it, on the JScrollPane
it's in, and on the labels that do the rendering. But the table is
still not showing the color of the JPanel that the JScrollPane is in.
Instead, it's gray. Am I making some common mistake here?

You probably are, but I can't tell what - because you didn't post any
code. See http://sscce.org.

I quickly wrote a small (< 100 lines) example program which worked OK
for me.
 
R

RedGrittyBrick

RedGrittyBrick said:
You probably are, but I can't tell what - because you didn't post any
code. See http://sscce.org.

I quickly wrote a small (< 100 lines) example program which worked OK
for me.

My guess is you forgot scrollPane.getViewport().setOpaque(false);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,438
Messages
2,571,699
Members
48,796
Latest member
Greg L.
Top