Core swing (and currently swingx neither) does not support semi-transparent background colors - due to the well-known opacity catch-22:
- the background is filled only if isOpaque (note: the getter)
- reporting isOpaque for not fully opaque colors is illegal, doing so will produce the artefacts
The usual workaround is to set opacity to false and subclass JPanel to take over the background filling before calling super. As JXPanel already takes over much of the background painting (filling and painter), we should support it.
There are two sides of the coin:
- complying to opacity contract, that is to automatically adjust the opacy to false if the background color is semi-transparent
- detect and respect the developer's intention whether or not the background should be filled (independent on it's transparency)
We have an old issue (marked as fixed, though I disagree a bit) for the second part in
Screenshots of the three-panel example - it's under version control, so can be seen in locally on checkout, in localPath/www/api-reviews/... The screenshots are produced by running JXPanelVisualCheck.backgroundAlphaToggleOpaque with the ui property "JXPanel.patch"
set to Boolean.TRUE.
to be continued ...