Take the 2-minute tour ×

Is it possible to make one specific color transparant in a JFrame?

I know that it is possible in VB.NET, but I would like to know it whether or not it is possible in Java!

For example: My JFrame has a red backgroundcolor and I want for only that red color to become transparent, so that where that red was, I see the behind laying form/desktop.

Hope someone can help, because I'm stuck!

share|improve this question
add comment

1 Answer

You could use

com.sun.awt.AWTUtilities.setWindowShape(Window, Shape)

with a custom Shape implementation that contains only points whose color is different from your specific color.

share|improve this answer
thanks im looking is it works now –  Dave Jul 4 '12 at 8:29
don't forget to mark this answer as answered when it helped you :) –  Kees Sonnema Jul 5 '12 at 13:59
add comment

Your Answer


