Link to home
Start Free TrialLog 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
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Gregg

ASKER

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