wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes JDialog undecorated with Metal Look and Feel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JDialog undecorated with Metal Look and Feel" Watch "JDialog undecorated with Metal Look and Feel" New topic
Author

JDialog undecorated with Metal Look and Feel

David Garratt
Ranch Hand

Joined: Aug 08, 2003
Posts: 196

Maybe I'm doing something silly, but try and I might I don't seem to be able to turn off the title bar, close button etc using the setUndecorated function.

Should this be possible or is there a restriction to the Metal Look and feel.

Thanks

Dave
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> I don't seem to be able to turn off the title bar, close button etc using the setUndecorated function.

are you using 'true' with setUndecorated?
David Garratt
Ranch Hand

Joined: Aug 08, 2003
Posts: 196

Yes I am doing that, if I run the Dialog standalone I get the desired result, but when it's being created and invoked from my application it retains the decorations. It's like it's in inheriting the properties from the parent JInternalFrame.

Dave
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
in the absence of any code, all I can guess is that you have a duplicate declaration of the dialog,
when invoked from the internalFrame i.e. the undecorated one is not the one showing
David Garratt
Ranch Hand

Joined: Aug 08, 2003
Posts: 196

I found the problem.

In my applications startup (not part of the dialog itself) I had

JDialog.setDefaultLookAndFeelDecorated(true);

I thought this would be a "default" which I could override, however is seems not.

If you set this then you don't seem to have any choice for specific dialogs later on.

Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDialog undecorated with Metal Look and Feel