创建jframe时出错

时间:2014-06-15 10:53:09

标签: user-interface jframe

帮助新手我在创建jframe或gui时总是遇到此错误我不知道如何解决这个问题。

 Exception in thread "main" java.lang.UnsatisfiedLinkError: sun.awt.windows.WToolkit.startToolkitThread(Ljava/lang/Runnable;Ljava/lang/ThreadGroup;)Z
    at sun.awt.windows.WToolkit.startToolkitThread(Native Method)
    at sun.awt.windows.WToolkit.<init>(Unknown Source)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at java.awt.Toolkit$2.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.Toolkit.getDefaultToolkit(Unknown Source)
    at sun.java2d.d3d.D3DGraphicsDevice.<clinit>(Unknown Source)
    at sun.awt.Win32GraphicsEnvironment.makeScreenDevice(Unknown Source)
    at sun.java2d.SunGraphicsEnvironment.getScreenDevices(Unknown Source)
    at sun.awt.Win32GraphicsEnvironment.getDefaultScreenDevice(Unknown Source)
    at java.awt.Window.initGC(Unknown Source)
    at java.awt.Window.init(Unknown Source)
    at java.awt.Window.<init>(Unknown Source)
    at java.awt.Frame.<init>(Unknown Source)
    at java.awt.Frame.<init>(Unknown Source)
    at javax.swing.JFrame.<init>(Unknown Source)
    at MyJFrame.<init>(Gui1.java:6)
    at Gui1.main(Gui1.java:26)

1 个答案:

答案 0 :(得分:0)

它似乎与您的Java安装有关。您是否收到过以下消息:安装过程中安装失败。基本上,您的IDE无法找到本机Java库。请再次在您的计算机上重新安装Java。

类似的问题here ..