求用过native swing的大神帮忙

xiongmaowoca xiongmaowoca 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
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)
...全文

相关推荐

评论 2
收藏 已收藏
分享
返回顶部
xiongmaowoca
Java SE 62,621 成员 307,251 内容