求用过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)
...全文
240 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
xxnwxf2 2013-01-31
  • 打赏
  • 举报
回复
http://blog.csdn.net/migu4423/article/details/8514363
xiongmaowoca 2013-01-23
  • 打赏
  • 举报
回复
顶 ~~

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧