1

I have been having this problem for quite some time and I've been unable to find the solution anywhere on the internet.

I have a JDialog as my main frame and I need to be able to change the transparency of the window. Normally this would not be a problem if I was to call setUndecorated(true) on it, but I do not want to do that. I want the title bar to appear at the top under the system look and feel.

The interesting part is that on my Mac, changing the transparency works just fine with the system look and feel, even though the JDialog is still "decorated".

Here's an image of my JDialog so you know what I'm dealing with:

Image

I need to use the system look and feel, but I also need to be able to change the transparency of the window.

When I try, I get the following exception on windows:

"Exception in thread "AWT-EventQueue-0" java.awt.IllegalComponentStateException: The dialog is decorated"

If I set it to undecorated, I lose the title bar at the top which is not an option. Anybody know a way around this?

Mark
  • 418
  • 1
  • 4
  • 13
  • 2
    You may go directly to this link: [**Can't transparent and undecorated JFrame....**](http://stackoverflow.com/questions/16219111/cant-transparent-and-undecorated-jframe-in-jdk7-when-enabling-nimbus) – Azad Jul 16 '13 at 16:21
  • Have a look at [creating Translucent Windows](http://docs.oracle.com/javase/tutorial/uiswing/misc/trans_shaped_windows.html) – nIcE cOw Jul 16 '13 at 16:22
  • 1
    @nIcEcOw: the official tutorial is not working with System L&F. – Azad Jul 16 '13 at 16:25
  • 1
    true is (seems) not working in Java7, there is important is code ordering – mKorbel Jul 16 '13 at 16:26

0 Answers0