Java integrated or embedded browser - java

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

Related

How to embed jetty and webkit like Electron framework does?

We have distributed web application and front-end part of this application should be standalone desktop application and have integration with desktop apps such as telephony. I saw Electron framework and apps (for instance Slack) built on top of it and it is pretty good.
Does Java world have such a tool for embedding of jetty/tomcat and webkit browser to built native desktop apps?
Similar questions:
Use embedded web browser (e.g. Chrome) as GUI toolkit for Java desktop applications?
Is it possible to create Desktop Application using Java backend & Web Technologies UI
Performance of WebView in JavaFX
Integrating JavaFX 2.0 WebView into a Swing Java SE 6 Application
Update:
See my test application on Java CEF: https://github.com/jreznot/cefc.
It uses Jetty/Swing/JavaCEF/Vaadin as HTML 5 Desktop Stack.
Final Update:
See my Electron+Java madness: https://github.com/jreznot/electron-java-app
It uses Electron with Java server side and Vaadin for application UI.
I recommend to use Electron instead of Java-Webkit bindings because it is mature framework and it has large community of JS developers.
I have search for similar solution in these last days and haven't found a totally fine solution.
These below is the more interesting partials solutions I have found.
Embed a browser (chromium) in java
I found two web site and is unclear what is the better solution:
jcef on github.com
build instructions
jcef on bitbucket.org
build instructions
I am not sure if these embedding solution will work well.
Please let me known if someone have found a quicker solution to embed web browser.
If you embed the browser into your code you have not trouble if the browser will update itself in the future and the user have your window container unless the standard browser window.
If you use an external browser you are sure on it well known behaviour but it can be change in the future and if this happens you have to update your application.
I choose to avoid embedded browser and reuse a standard external browser.
Embed http server
I like two solution I have found. All these solution can be use with minimal code change on your web application.
One thing is better you do is to make your web application a Maven application.
To do this in the past I have look at every library in web application class path and put in maven pom.xml dependency tree.
Spring-boot framework
Spring-boot is part of Spring framework.
It is a Spring projects: Spring-boot.
This project help a lot to start your web application.
Since you are developing a web application, you will add a spring-boot-
starter-web dependency in maven pom.xml
It standard embed server web is tomcat7/8 but you can change to Jetty8/9 or Undertow 1.1
Spark framework
This framework is a good alternative to Spring-boot. It is more concise and use Jetty as embedded web server.
I like Spring-boot because I am use to Spring configuration and use a mix of xml/annotation configuration and I like spring IoC. Using Spring-boot it easy to add other Spring constellation capability.
I hope that this can help you.
I think you can use wt. This is a system that takes a Qt based GUI application and rewrites the drawing mechanism from the usual desktop controls into html controls on a web page. IIRC its very transparent in that you only need to change a line or two of your original code. Qt is not java though, so I'm only pointing it out for completeness, its still pretty cool though.
But the simplest way would be to implement it using web technologies (eg HTML/JSP controls) so that it can be displayed as a web page easily, and then create a desktop app that uses the same html pages only wrapped as a 'executable'.
To create a desktop application you can either view the web page in an embedded browser in an application that exists solely to show the browser in a window, or you can use something like Microsoft's HTA system that presents web pages as desktop-style windows.
Credit goes to #gbjbaanb
Resource Link:
Is it possible to have a single code base for a desktop GUI and a
web application?
Run Jetty Web Server Within Your Application
Running a web application (WAR) with embedded jetty server

Java Browser library

I need to implement a simple browser in java. I've been researching several possibilities including JxBrowser, JBrowser, JavaFX (WebEngine + WebView), among others. JxBrowser has potential but it's a paid library, which I would like to avoid.
This browser needs to be able to process all web functionalities including JavaScript and HTML5 while capable of connecting through proxies. Therefore the best solution may be to use a web engine like Gecko.
So I'd like some advice on libraries which are capable of implementing Gecko engine (including XULRunner) with the possibility of changing core Gecko preferences.
Also, if you know any other possible solution that doens't include Gecko, feel free to discuss.
Have you tried SWT Browser widget?
For proxy in SWT Browser, see How do I set a proxy for the Browser to use?,

Getting Chrome Browser in java Applications

Is there a way to get the Chrome browser inside of java applications similar to the way Awesomium works in C++ and C# applications?
There is currently no way getting the UI portion into a Java. You should consider just using barebone WebKit + V8 with many JNI calls. You could consider writing a JNA wrapper around those.
To make your JNA easier, you can wrap Chromium Embedded Framework
There's a Java Wrapper for the Chromium Embedded Framework (CEF).
Try javacef. This is open source project. This project can embed Chromium browser in Java SWT with multitab browser support, cookies manipulation, tab settings, printing, back, forward, refresh buttons and enhanced file download. This project is based on Chromium Embedded Framework (CEF).

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.

Java and Silverlight together forever

I want to display a silverlight web page inside my java desktop application.
Does anyone know of a plugin or browser control that I can use to do this?
Embed an appropriate browser window into the Java app and it can load the SL - there will not be any interaction / communication between the two without some hacky code. Multiple browsers support SL but you are better off using the an IE based one at present, the chrome support is not official as I remember.
How about an iFrame? In the nutshell... Alternatively you can make a request to .Net app from within your java server code using something like HttpClient and then serve markup that way - would be relatively easy thing to do (relatively since if there authentication involved things can get complicated fast. And if you want (willing) to get "sophisticated" and you are using portlet technology there is WSRP
For the desktop app I would go with HttpClient suggestion: get the content, parse it then do with it what you please unless that Silverlite app is also running as webservice then you have some additional options by utilizing components that can consume services
Eclipse's SWT provides out of the box web browser component based on IE and/or Mozilla engine. For swing application you can use one of ActiveX bridges, such as J-Integra or JDIC or EZ JCOM.
Use JDIC WebBrowser component

Categories

Resources