I use JXBrowser in one of my projects in Java to do a simple display of the googlemaps webpage so that I can trace routes on there, but recently I want to improve that project, but my problem is that the license for the JXBrowser expired (only one month), I can't just ask for another license, it doesn't work that way. So I am looking for an API similar to the JXBrowser, do you guys know any?
Asked
Active
Viewed 7,658 times
5
-
So i searched for a similar solution and i found webView that is jfx component but i dont know how to use it, can anyone help me? – props Jan 28 '17 at 15:09
-
1you can not use jfx for complex webpages such as googlemaps, jfx is not a real browser and fails on complex webpages (rich css, javascript etc), even if the page is rendered, you get performance problems, freezes, and does not response user actions properly. if your target os is windows, you may use dj browser. https://sourceforge.net/projects/djproject/ it is opensource and free, but does not support macosx. – benchpresser Jul 25 '17 at 06:39
-
2There are a few (SWT component, Lobo, mozswing). I can note that TeamDev spend a lot of time since 2007 to make this one the best. There are important features like: Latest browser engine (Chromium now days with V8 JavaScript), most another APIs don't updating it. Interposes integration instead of unsafe JNI bindings, same to the Chrome tabs approach. Rich API - you can control most of browser features like proxy config or page scripts. If you working on a Open Source or academic project they can give you a free license. – Victor Gubin Mar 02 '18 at 19:03
2 Answers
7
You can use WebView - JavaFX component. It's a reasonable choice for simple pages, it offers a really good time to effect ratio
WebView webView = new WebView();
webView.getEngine().load("https://www.google.com/maps");
If you need something more powerful and you can't get a license for JxBrowser - there is also JCEF project:
Unfortunately it works only with AWT/Swing because it's too complex to embed it in SwingNode. I mentioned that here:
With JCEF-based projects you'd have to think about supported platforms. There're different variants of natives and platform-specific problems, for example:

dzikoysk
- 1,560
- 1
- 15
- 27
-
1The [correct URL](https://docs.oracle.com/javafx/2/webview/jfxpub-webview.htm) lacks the final “l”. – Olivier Cailloux Oct 17 '21 at 12:10
0
There are two alternatives for JxBrowser: JavaFX WebView and JCEF.
In the following articles you can find out what's the difference between them:
Also, you might want to take a look at the Browser Integration in Java Applications article.

Vladimir
- 1
- 1
- 23
- 30
-
1I do not think JavaFX is an alternative. It fails on many cases, crashes on complex websites, has performance issues as well. And not supported anymore, it is a dead project and will be history soon. – benchpresser Jan 19 '23 at 21:37