Look at this picture :
here is the code that transparent's the frame:
GraphicsEnvironment ge =
GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice gd = ge.getDefaultScreenDevice();
if (!gd.isWindowTranslucencySupported(TRANSLUCENT)) {
System.err.println(
"Translucency is not supported");
System.exit(0);
}
JFrame.setDefaultLookAndFeelDecorated(true);
this works good but when trying to enable LookAndFeel by adding
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
}catch(.......)
it gives me this error
Exception in thread "AWT-EventQueue-0" java.awt.IllegalComponentStateException: The frame is decorated
What's this error ? and how to solve it ?
Thanks for your answers and suggestions.
EDIT
Question Asked/CrossPosted
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…