0

Hello!

1)Is it possible to understand which minimum Java version need (support) my code to run properly?

2)I use JFrame but that does not changes my icon on window?

Image logo = Toolkit.getDefaultToolkit().getImage("logo.png");
setIconImage(logo);

3)Also that code throws an Exception

Class<?> awtUtilitiesClass = Class.forName("com.sun.awt.AWTUtilities");
Method mSetWindowOpacity = awtUtilitiesClass.getMethod("setWindowOpacity", Window.class, float.class);
mSetWindowOpacity.invoke(null, this, Float.valueOf(0.75f));

Exception:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at MainGUI.<init>(MainGUI.java:52)
at QuickJavaDnsChanger.OpenGUI(QuickJavaDnsChanger.java:128)
at QuickJavaDnsChanger.main(QuickJavaDnsChanger.java:45)
Caused by: java.awt.IllegalComponentStateException: The frame is decorated
at java.awt.Frame.setOpacity(Unknown Source)
at java.awt.Window$1.setOpacity(Unknown Source)
at com.sun.awt.AWTUtilities.setWindowOpacity(Unknown Source)
... 7 more

Can someone please help me about them?

Thank you!

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by mKorbel
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.