Dmitriy Likhten
Dmitriy Likhten

Reputation: 5216

Java Swing: Make a dialog partially transparent.

I have a need to make my dialog partially transparent. Pull out a tab from google chrome to create a new window, while dragging the shape it makes is the shape that I want to make, minus see-through.

The point is that my dialog is a fairly simple and standard dialog, but I need one chunk of it cut out and transparent. Double points if that area is not part of the dialog so clicking there will lose focus from the dialog.

Upvotes: 1

Views: 1456

Answers (1)

Leon
Leon

Reputation: 1141

you can set the opacity.

http://java.sun.com/developer/technicalArticles/GUI/translucent_shaped_windows/#Setting-the-Opacity-Level-of-a-Window

I see what you mean by chrome page tab. In this case you may have to have an underlying panel which is transparent, this panel would then contain the tab in the top corner, and the rest of the page underneath. ie 2 separate components

hope that is what you very looking for

Upvotes: 3

Related Questions