44

What's the best cross platform Java Swing browser component at least able to play nicely in a swing interface (lightweight component ?) and able to run on MacOSX and Windows ?

Things like : FlyingSaucer, JDIC, maybe others ?

JeanLaurent
  • 716
  • 2
  • 8
  • 12
  • You can find how to embed an HTML rendering component into Swing here: http://stackoverflow.com/a/27754819/363573 – Stephan Jan 03 '15 at 12:26
  • A similar question with more up-to-date answers https://stackoverflow.com/questions/56707231/web-browser-control-in-java – Vladimir Feb 17 '21 at 08:20

5 Answers5

36

i belive this could help:

http://djproject.sourceforge.net/ns/index.html

João Vieira
  • 1,102
  • 1
  • 13
  • 17
5

The Lobo Browser could be what you're looking for:

http://lobobrowser.org/index.jsp

It's GPL and renders JavaFX as well as HTML


Edit

JavaFX 2.0 comes with a Browser component: http://docs.oracle.com/javafx/2/webview/jfxpub-webview.htm

tim_yates
  • 167,322
  • 27
  • 342
  • 338
  • 3
    Lobo is almost useless, in that too many websites don't render right. – Mike Sep 22 '10 at 21:58
  • @Mike Here is an alternative to Lobo: http://stackoverflow.com/a/27754819/363573 – Stephan Jan 03 '15 at 12:27
  • @Stephan or use Java 8's web view component – tim_yates Jan 03 '15 at 13:41
  • @Stephan I'm nervous about introducing a whole other native SWT rendering subsystem. Eclipse still after all these years still shows redrawing bugs for instance (which uses SWT). – Mike Jan 05 '15 at 04:40
  • 1
    @tim_yates I've contemplated this in the past. At one point there was a promise that web-view would be a way to use the WebKit based browser component, but that it wasn't available on Linux. However, from what I gathered, these days, both with Java 7 and 8, one can expect web-view to simply work on Linux (and Windows and Mac). Is that correct? Of course, I'd have to shoe-horn the JavaFX based web-view component into my Swing application using the right wrappers. Why couldn't Oracle simply have made available a JWebView or something like that? – Mike Jan 05 '15 at 04:44
  • Link not working – Blunderchips Aug 03 '18 at 11:01
  • Things move on over 10 years – tim_yates Aug 03 '18 at 11:11
  • Javafx now has a pretty decent browser component – tim_yates Aug 03 '18 at 11:11
4

you can go for Mozswing which have all the features that mozilla firefox 3.0 supports .. but the same is heavy.

  • Mozswing has been dead for quite a while and only supports 32 bit. – Mike Sep 22 '10 at 21:58
  • 1
    SWT Browser component supports both 32bit and 64 bit. Here is a sample usage: http://stackoverflow.com/a/27754819/363573 – Stephan Jan 03 '15 at 12:28
3

We (@ WebRenderer) believe we have the best Java browser SDK - http://www.webrenderer.com/ WebRenderer is Swing based using Firefox as the underlying engine, and supports HTML5, SVG, etc on both 32 and 64bit systems.

  • 2
    Welcome to Stack Overflow! Thanks for posting your answer! Please be sure to read the [FAQ on Self-Promotion](http://stackoverflow.com/faq#promotion) carefully. – Andrew Barber Sep 04 '12 at 00:58
  • Thank you Andrew for your contribution. I checked the FAQ before posting my response, and hence made sure to identify my association with WebRenderer. Whilst we are on this topic you may however wish to look at Vladimirs (of JXBrowser) posts (user #459345 and user#241010) above. Secondary, I decided to post WebRenderer as it is not only relevant to the discussion but also for completeness. WebRenderer was previously posted on this Question as an answer back in 2009 by Lukasz (last name withheld) – http://goo.gl/8263M – Duncan Thomas Sep 05 '12 at 02:21
  • Lukasz Drukarz posted a link-only answer on July 1, 09, and it was deleted because it was only a link. (as a 10k user, I can see deleted posts). I saw Vladimir's post, and would have left a comment for him as well, but he has not been on the site for quite some time (over 2 years). This type of question, and the answers that it generates, are not generally preferred around here, and this question has been protected and flagged for closure. – Andrew Barber Sep 05 '12 at 02:34
  • This question is in fact quite problematic, most'best to do this' question are since they (naturally) just attract links. The accepted answer to this question is, in fact a link. Deleting self promotional answers on a question basically _asking_ for them is not going to help, so I have closed this instead. – Tim Post Sep 05 '12 at 03:31
1

Highweight browser based http://code.google.com/p/jbrowser/. It use Canvas component.

caiiiycuk
  • 1,466
  • 14
  • 20
  • jbrowser is now deprecated. The recommend solution is SWT Browser (http://stackoverflow.com/a/27754819/363573) – Stephan Jan 03 '15 at 12:29