Substance UI & undecorated JDialog/JFrame
I have noticed that while using the Substance UI for Java that when I set a new JFrame or JDialog to undecorated it is not honored.
e.g.
frame.setUndecorated(true);
frame.setVisible(true);
When run under Substance shows a decorated frame.
When run开发者_开发问答 under system default L&F shows an undecorated frame.
Anyone have ideas for working around this? I have been unable to find anything on this at the Substance website/java.net forums or already existing in SO.
Thank you to The Alchemist for solving my problem:
Have you tried setting JFrame.setDefaultLookAndFeelDecorated() before bringing up your the first window? – The Alchemist Sep 7 at 12:18
This is a very old question, however for anyone who finds this post:
The problem with using,
JFrame.setDefaultLookAndFeelDecorated(false);
to fix the undecorated issue, is that it causes ALL of your dialogs to use the default look and feel when they are DECORATED. If you'd just like one dialog to be undecorated without affecting all the other dialogs, call this on your dialog after setting it undecorated:
getRootPane().setWindowDecorationStyle(JRootPane.NONE);
精彩评论