Topic: 熟悉jface的达人进,不胜感激。

  Print this page

1.熟悉jface的达人进,不胜感激。 Copy to clipboard
Posted by: marsbible
Posted on: 2005-04-04 16:42


import java.io.*;
import org.eclipse.jface.viewers.*;
import org.eclipse.jface.window.*;
import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
public class FileTree extends ApplicationWindow
{
public FileTree()
{
super(null);
}
protected Control createContents(Composite parent)
{
TreeViewer tv = new TreeViewer(parent);
tv.setContentProvider(new FileTreeContentProvider());
tv.setInput(new File("C:\\"));
return tv.getTree();
}
public static void main(String[] args)
{
FileTree w = new FileTree();
w.setBlockOnOpen(true);
w.open();
Display.getCurrent().dispose();
}
}

运行上面的代码出现这个问题:
java.lang.NoClassDefFoundError: org/eclipse/core/runtime/ISafeRunnable
似乎是jface找不到runtime插件,不知道为什么。

2.Re:熟悉jface的达人进,不胜感激。 [Re: marsbible] Copy to clipboard
Posted by: kite
Posted on: 2005-04-05 10:04

你这是standlone的程序,在运行的时候要把所需的类库要加全。这个需要添加
org.eclipse.core.runtime的jar包。


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923