求用过native swing的大神帮忙

xiongmaowoca 2013-01-23 03:09:36
import java.awt.BorderLayout;
import java.awt.Container;
import javax.swing.JFrame;

import chrriis.common.UIUtils;
import chrriis.dj.nativeswing.swtimpl.NativeInterface;
import chrriis.dj.nativeswing.swtimpl.components.JWebBrowser;



import javax.swing.JScrollPane;
import javax.swing.ScrollPaneConstants;
import javax.swing.SwingUtilities;


public class SwingHello extends JFrame{

/**
*
*/
private static final long serialVersionUID = 1L;
/**
* @param args
*/
static Container c;
public static void main(String[] args) {
UIUtils.setPreferredLookAndFeel();
NativeInterface.open();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JFrame frame = new JFrame("法务通");
frame.setUndecorated(true);// 禁用此窗体的装饰
frame.setLocationRelativeTo(null);//居中显示
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(getGUI(), BorderLayout.CENTER);
frame.setSize(938, 614);
frame.setLocationByPlatform(true);
frame.setVisible(true);
}
});
NativeInterface.runEventPump();

}
public static JScrollPane getGUI(){
JScrollPane webBrowserPanel = new JScrollPane();
webBrowserPanel.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
final JWebBrowser webBrowser = new JWebBrowser();

webBrowser.setBarsVisible(false);
webBrowser.navigate("table.html");
webBrowserPanel.add(webBrowser, BorderLayout.CENTER);

return webBrowserPanel;
}


}
报错:
Exception in thread "main" java.lang.IllegalStateException: The version of SWT that is required is 3.5M6 or later!
at chrriis.dj.nativeswing.swtimpl.NativeInterface.initialize(NativeInterface.java:149)
at chrriis.dj.nativeswing.swtimpl.NativeInterface.open(NativeInterface.java:182)
at SwingHello.main(SwingHello.java:30)
...全文
203 2 点赞 打赏 收藏 举报
写回复
2 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
xxnwxf2 2013-01-31
http://blog.csdn.net/migu4423/article/details/8514363
  • 打赏
  • 举报
回复
xiongmaowoca 2013-01-23
顶 ~~
  • 打赏
  • 举报
回复
相关推荐
发帖
Java SE
加入

6.2w+

社区成员

Java 2 Standard Edition
申请成为版主
帖子事件
创建了帖子
2013-01-23 03:09
社区公告
暂无公告