Eclipse3.2 swt问题

来源:百度知道 编辑:UC知道 时间:2024/06/20 13:47:52
昨天下了一个swt插件,用Eclipse建立了一个java project后,随便拖了一个组件然后运行,出现了一个异常:大家帮忙看一下,在线等!
Exception in thread "main" java.lang.UnsatisfiedLinkError
java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1030)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:123)
at org.eclipse.swt.internal.win32.OS.<clinit>(OS.java:18)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:125)
at yzj.note.NoteFrame.open(NoteFrame.java:30)
at yzj.note.NoteFrame.main(NoteFrame.java:20)
刚接触swt,就是不知道配没配好,怎么样才能称得上配好了?

给你个例子试试
publicclass HelloWorld{

publicstaticvoid main(String[] args){

Display display=new Display();

Shell shell=new Shell(display,SWT.V_SCROLL|SWT.SHELL_TRIM);

shell.setText("This is my label");

shell.setBounds(100,100,500,200);

shell.setLayout(new FillLayout());

//Color red=new Color(display,255,0,0);
Label label1=new Label(shell,SWT.CENTER);
label1.setText("Hello word");
label1.setLocation(100,100);
label1.setBackground(new Color(display,0,200,0));
new Label(shell,SWT.CENTER).setText("software college of neu");
shell.open();
while(!shell.isDisposed()){
if(!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}运行的时候run as:(选)2:swt applications

先试试这个例子,不行的话,就是没配好
插件跟其