views:

4409

answers:

11

Is there a way to embed a browser in Java?

+1  A: 

You can try Webrenderer or Ice Browser

Bart
Ice Browser is not actually sold anymore, the product has reached End of Life
willcodejavaforfood
+9  A: 

I believe JWebPane is going to be the official way to embed a browser into a java app. Its based on the open sourced engine - WebKit, which is used in Apples Safari and Googles Chrome browsers.See this blog for details.

Jimmy
As for march 3 2009, this is still not possible.
OscarRyz
As of 9/21/2009, this is still not possible.
jrhicks
As of 12/23/2009, this has not possible
jumar
JWebPane shows no signs of activity/life... However mozswing seems to work pretty well. I tried the JNLP download version and it the page renders well. Memory usage is a high, but support for web standards is good as it is based on the Mozilla browser. Available at http://confluence.concord.org/display/MZSW/Home
Thimmayya
As of april 2010, this is not possible. It seems JWebPane is vaporware :(
Kees Kist
June 2010; still no sign..
pierre
+5  A: 

You could use SWT for your GUI. Its Browser control allows you to embed IE, Mozilla or Safari (depending on the platform you're running in) with little pain.

alexmcchessers
+1  A: 

I have successfully opened a browser from Java using SWT. You can find code examples of how to use SWT to open a Browser window. It's very easy to do.

Eddie
+1  A: 

By far the most robust embeddable browser I am familiar with is the one in SWT. In fact, it is so flexible that the JavaDoc hover you can see in Eclipse is actually a browser, and the JavaDoc view actually supports things like animation!

The only risk with using SWT is that there are different versions of the SWT library for different platforms. I'm not sure if there is a singl jar you could include to cover everyone.

Uri
+1  A: 

You can embed a browser in a Swing/AWT GUI using the JDIC API. I don't see any mention of OS X, so it may not be of use to you.

McDowell
+1  A: 

Take a look at https://xhtmlrenderer.dev.java.net/

l_39217_l
+3  A: 
OscarRyz
+2  A: 

If you need a pure Java solution then you can try JWebEngine. It render HTML 4 very good. You can use it in an applet, Java webstart and on any platform. The using is very simple.

Horcrux7
+1  A: 

JxBrowser has not been mentionned yet. It embed either Mozilla Firefox (Gecko), Apple Safari (WebKit) or Internet Explorer. Programmer's Guide

h3xStream
A: 

I'm using JxBrowser library in my Xtms Client product to embed Mozilla rendering engine for a web page preview. It works well on Windows platform (didn't test it on Mac OS X and Linux yet). API is very simple, so I could embed Browser component in my application in 5 minutes.

Vladimir