Link to home
Create AccountLog in
Avatar of Gregg
GreggFlag for United States of America

asked on

Why are JLabels not transparent in my JList?

Any idea why the JLabels arent transparent?

My process:
1.Create a JPanel using GridBagLayout Manager. Add a few JLabels.
2. Add the JPanel to an object array.
3. Pass object array into JList (setListData() method)
4. Call the setCellRenderer(new JListRenderer()) method

And it displays on screen with gray bg. Where am i going wrong?

Any thoughts or suggestions are appreciated.

 User generated image
ASKER CERTIFIED SOLUTION
Avatar of for_yan
for_yan
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of Gregg

ASKER

Yeah! I had it backwards, i had setOpaque(true).  Thanks for your help!