WebKit browser in Java app on multiple platforms - java

I'm trying to embed a WebKit browser in my Java app. I insist on WebKit, because I don't want to test my HTML5/CSS/Javascript with every browser that, for instance, the Browser widget in the Eclipse SWT library supports.
Is there a way to do this on Mac, Windows and Linux, and thus make sure that my web pages are rendered inside my Java app uniformly?

Since SWT 3.7 M5, the Browser widget can use WebKit on all platforms if created with the SWT.WEBKIT flag. Platform-specific conditions may apply: see http://www.eclipse.org/swt/faq.php#howusewebkit.

JXBrowser is one option. It's including Safari.
WebKit 4 SWT is close to what you need but only work on Windows for now.

Related

Java browser that support applet

Is there's any java embedded web browser(free) that support applet running ?
I don't mind if its use some native libraries.
Currently ,I already tried javafx web view and DJnativeswing and they dont detect java(doesn't support applet).
Most of the modern browsers (Chrome v42+, Firefox 64 for Windows, Microsoft Edge, etc) have dropped support for NPAPI which is required for applets to run. Oracle is recommending that developers switch over to Java Web Start instead of using applet as the technology is fading. If you still need to use applets (eg. for school programming projects) you may need to uninstall your current browser(s) and install a legacy browser that still includes NPAPI.
Browser do not support applets nativly. That's because applets need a java runtime environment and an browser adapter to display the content in the browser. But if you install a jre it always will install an plugin into you browser(s) if not already present.

Chrome packaged app with a Java applet

Is it possible for a Chrome packaged app to contain a Java applet?
I'm attempting to integrate QZ-Print / jZebra into a packaged app, however the applet does not appear and JavaScript receives an error of applet / can't read method of undefined when attempting to call a function.
No, you cannot use any (NPAPI) plugin in a Chrome app.
The documentation lists several Disabled Web Features. Flash and Non-sandboxed plugins are both listed, so they cannot be embedded in a Chrome app. Flash -as a (sandboxed) PPAPI plugin- could be embedded inside a <webview> tag, but Java is a non-sandboxed NPAPI plugin, so it cannot be used in a <webview> tag.
And you cannot use Java applets within a legacy packaged app either, because Java does not support Chrome extensions. You might have more luck if you try to embed the Java applet from a http(s) site.
Note that both Java applets and legacy packaged apps are deprecated and going to be removed from Chrome in the future (announcement for Java plugins, announcement for packaged apps), so you should try to look for alternatives such as native messaging.
It will be an ad-hoc solution, but you can set "always allow" manually in chrome://plugins

Java integrated or embedded browser

I need a integrated or embedded java browser. I used WebEngine of javafx which support basic css as well html & java script but could not able to run flash file. Any way to do so.
Or any other Project u know which could fulfill my requirement.
You can also look at JxBrowser Java library that allows embedding Chromium-based web browser control into Java AWT/Swing application.
It supports both Java Swing and 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.
Check those (although they are not JavaFX but I suppose that they can be used):
http://lobobrowser.org/java-browser.jsp - pure Java
http://www.javadesktop.org/articles/jdic/index.html - better imho, but no longer maintained

Embedding a web browser in a java application on Mac OS X

I'm developing a cross-platform desktop application using Java. My application requires displaying a couple of websites from within my application and not to open them in any full fledged web browser like Safari or Firefox. I've found some Java libraries and projects for accomplishing this for Windows like The DJ Project, JDIC for Processing and [Lobo Browser]. But most don't support Mac OS X or maybe I can't figure out how to run them on a Mac. I managed to run Lobo Browser as a simple frame and load a page, but the project is about 2 years old and doesn't render pages properly.
Please suggest if there is any cross-platform library available for embedding a web browser in a java program or even mac only library would do.
Take a look at Qt Jambi, a java API for the Qt toolkit, specifically the WebKit package. Full DOM rendering with or without a GUI.

How to embed an XUL Application in SWT Browser?

I want to host my XUL application inside another Java application that uses SWT.
I know that it is possible to embed the browser windows using SWT.MIZILLA as a flag.
But how do I host my XUL application inside that browser window?
You should be able to load your XUL file using Browser.setUrl() method. If you are on Linux, no need to specify SWT.MOZILLA (as embedded Firefox is also capable of loading XUL). Be careful when using SWT 3.7 (its M1 is just released), as it uses WebKitGtk+ as the default browser on Linux.

Categories

Resources