In my application, I show a popup dialog to show a large list of cards. I show them as images in many components JLabelin a subclass JPanel. Then I put this object in JScrollPaneto allow horizontal scrolling across the maps.
I want the unused space to be transparent with a dark background to show what is turned off behind it. I used setBackground(new Color(50, 50, 50, 200))to achieve the look that I want, but the content behind it does not redraw, so I get artifacts.
Here's what it looks like:

How can i fix this? How can I get the content to redraw it while scrolling?
Thanks in advance.
source
share