Webkit浏览器在Java应用程序中

时间:2022-11-19 09:54:47

I was wondering if there was a Java swing component that uses webkit. Is it possible to create a webkit browser in Java - must I use JavaFX ?

我想知道是否有一个Java swing组件使用webkit。是否可以在Java中创建webkit浏览器——我必须使用JavaFX吗?

5 个解决方案

#1


7  

There is one in development by Swing Team: http://weblogs.java.net/blog/ixmal/archive/2008/05/introducing_jwe.html

Swing Team正在开发一个:http://weblogs.java.net/blog/ixmal/archive/2008/05/introduction _jwe.html

#2


3  

I develop this browser for my college project may be this helpful for you

我为我的大学项目开发这个浏览器可能对你有帮助

My Button is open source java web browser.

我的按钮是开源的java web浏览器。

Develop for school and college projects and learning purpose. Download source code extract .zip file and copy “mybutton” folder from “parser\mybutton” to C:\

为学校和学院的项目和学习目的而发展。从“解析器\mybutton”到C:\,下载源代码提取.zip文件和复制“mybutton”文件夹。

Import project “omtMyButton” in eclipse. Require Java 6.

在eclipse中导入项目“omtMyButton”。需要Java 6。

Download .exe and source code : https://sourceforge.net/projects/omtmybutton/files/

下载.exe和源代码:https://sourceforge.net/projects/omtmybutton/files/。

#3


3  

You can also look at cross-platform JxBrowser Java library that allows embedding Chromium-based web browser control into Java AWT/Swing application. The library is developer by the company I'm working for.

您还可以查看跨平台的JxBrowser Java库,它允许将基于chrome的web浏览器控件嵌入到Java AWT/Swing应用程序中。图书馆是由我工作的公司开发的。

It supports both Java Swing and JavaFX.

它同时支持Java Swing和JavaFX。

BTW: the browser control is totally lightweight. All rendering happens in a separate native process by native Chromium engine. The web page looks like it's displayed in Google Chrome.

顺便说一句:浏览器控件完全是轻量级的。所有渲染都发生在一个独立的本地进程中,由本地Chromium引擎完成。网页看起来像是在谷歌浏览器中显示的。

#4


2  

JCEF

JCEF (Java Wrapper for the Chromium Embedded Framework) is a Java wrapper around CEF, which is in turn a wrapper around Chrome:

JCEF (Chromium嵌入式框架的Java包装器)是围绕CEF的Java包装器,而CEF反过来又是围绕Chrome的包装器:

Both projects seem quite active and the browser rendering is much faster than JavaFX's WebView (at least with JDK 8u20).

这两个项目看起来都很活跃,浏览器呈现速度比JavaFX的WebView(至少是JDK 8u20)快得多。

JFXPanel

It is also possible to use the JavaFX WebView in a Swing application via the JFXPanel.

还可以通过JFXPanel在Swing应用程序中使用JavaFX WebView。

public class JavaFxWebBrowser extends JFXPanel {
    private WebView webView;
    private WebEngine webEngine;

    public JavaFxWebBrowser() {
        Platform.runLater(() -> {
            initialiseJavaFXScene();
        });
    }

    private void initialiseJavaFXScene() {
        webView = new WebView();
        webEngine = webView.getEngine();
        webEngine.load("http://*.com");

        Scene scene = new Scene(webView);
        setScene(scene);
    }
}

#5


-1  

SWT has support built-in for GWT, Windows, and OS X. Support for GWT and OS X will probably be less substantial than for Windows.

SWT支持内置的GWT、Windows和OS X,对GWT和OS X的支持可能不如Windows强大。

http://lists.macosforge.org/pipermail/webkit-help/2009-December/000548.html

http://lists.macosforge.org/pipermail/webkit-help/2009-December/000548.html

XULRunner probably has much better API access between Java and the DOM.

在Java和DOM之间,XULRunner可能有更好的API访问。

#1


7  

There is one in development by Swing Team: http://weblogs.java.net/blog/ixmal/archive/2008/05/introducing_jwe.html

Swing Team正在开发一个:http://weblogs.java.net/blog/ixmal/archive/2008/05/introduction _jwe.html

#2


3  

I develop this browser for my college project may be this helpful for you

我为我的大学项目开发这个浏览器可能对你有帮助

My Button is open source java web browser.

我的按钮是开源的java web浏览器。

Develop for school and college projects and learning purpose. Download source code extract .zip file and copy “mybutton” folder from “parser\mybutton” to C:\

为学校和学院的项目和学习目的而发展。从“解析器\mybutton”到C:\,下载源代码提取.zip文件和复制“mybutton”文件夹。

Import project “omtMyButton” in eclipse. Require Java 6.

在eclipse中导入项目“omtMyButton”。需要Java 6。

Download .exe and source code : https://sourceforge.net/projects/omtmybutton/files/

下载.exe和源代码:https://sourceforge.net/projects/omtmybutton/files/。

#3


3  

You can also look at cross-platform JxBrowser Java library that allows embedding Chromium-based web browser control into Java AWT/Swing application. The library is developer by the company I'm working for.

您还可以查看跨平台的JxBrowser Java库,它允许将基于chrome的web浏览器控件嵌入到Java AWT/Swing应用程序中。图书馆是由我工作的公司开发的。

It supports both Java Swing and JavaFX.

它同时支持Java Swing和JavaFX。

BTW: the browser control is totally lightweight. All rendering happens in a separate native process by native Chromium engine. The web page looks like it's displayed in Google Chrome.

顺便说一句:浏览器控件完全是轻量级的。所有渲染都发生在一个独立的本地进程中,由本地Chromium引擎完成。网页看起来像是在谷歌浏览器中显示的。

#4


2  

JCEF

JCEF (Java Wrapper for the Chromium Embedded Framework) is a Java wrapper around CEF, which is in turn a wrapper around Chrome:

JCEF (Chromium嵌入式框架的Java包装器)是围绕CEF的Java包装器,而CEF反过来又是围绕Chrome的包装器:

Both projects seem quite active and the browser rendering is much faster than JavaFX's WebView (at least with JDK 8u20).

这两个项目看起来都很活跃,浏览器呈现速度比JavaFX的WebView(至少是JDK 8u20)快得多。

JFXPanel

It is also possible to use the JavaFX WebView in a Swing application via the JFXPanel.

还可以通过JFXPanel在Swing应用程序中使用JavaFX WebView。

public class JavaFxWebBrowser extends JFXPanel {
    private WebView webView;
    private WebEngine webEngine;

    public JavaFxWebBrowser() {
        Platform.runLater(() -> {
            initialiseJavaFXScene();
        });
    }

    private void initialiseJavaFXScene() {
        webView = new WebView();
        webEngine = webView.getEngine();
        webEngine.load("http://*.com");

        Scene scene = new Scene(webView);
        setScene(scene);
    }
}

#5


-1  

SWT has support built-in for GWT, Windows, and OS X. Support for GWT and OS X will probably be less substantial than for Windows.

SWT支持内置的GWT、Windows和OS X,对GWT和OS X的支持可能不如Windows强大。

http://lists.macosforge.org/pipermail/webkit-help/2009-December/000548.html

http://lists.macosforge.org/pipermail/webkit-help/2009-December/000548.html

XULRunner probably has much better API access between Java and the DOM.

在Java和DOM之间,XULRunner可能有更好的API访问。