1

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.

Dmitriy Likhten
  • 5,076
  • 7
  • 36
  • 47

1 Answers1

3

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

Leon
  • 1,141
  • 13
  • 25
  • So make the window see-through, make a panel inside which contains 2 components positioned, each component is not see-through, any extra space is then see-through? I'm not quite following this... – Dmitriy Likhten Jul 28 '11 at 17:23
  • 1
    Note the method described by that link uses com.sun.awt.AWTUtilities which is not part of the API. Beginning with Java 7 the relevant methods in AWTUtilities have migrated to GraphicsDevice, GraphicsConfiguration, or Window. For details, see http://www.pushing-pixels.org/2009/05/03/translucent-and-shaped-windows-in-jdk-7.html – Devon_C_Miller Jul 29 '11 at 12:50