Question

Is it somehow possible on Swing to set a TitledBorder transparent so that a background image shines through?

Was it helpful?

Solution

Found the answer.

Use the method

setOpaque(false) 

on the underlying panel.

OTHER TIPS

Strange - TitledBorder.isBorderOpaque() supposedly returns false, so it should already work. Maybe the problem is just that the component you're putting the border on just doesn't paint the background image over the border insets?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top