Skip to main content

JWebPane project, a browser plugin for Swing and soon FX

Posted by alex2d on December 10, 2008 at 4:08 AM PST

JWebPane overview

Hello blog-o-sphere!

I'm the tech lead of the new JWebPane project, a browser plugin for Swing and soon
FX. We showed a preview this past JavaOne that was well received, and I wanted to
give everyone an update on where we are.

JWebPane is a WebKit based browser component for Java, and will be posted as open
source on in the near future. I'm planning on blogging here frequently,
discussing the architecture of the project as well as how to use it. There's a large
interest in general about WebKit so I'll also talk about some of the aspects of how we
integrated it into Java.

Here is the high level component scheme of the browser component, which also
shows how JWebPane inter-operates with WebKit engine.

We have four basic components:

  • Rendering
  • Networking
  • Timer
  • Events

Each component consists of two parts: the webkit api and a java based
implementation. Actually, there is one more part per each component which is not
mentioned above: the JNI glue code connecting pure java with native C++ based
WebKit. But, it's mostly the straight forward passing of the data so is not terribly
relevant to go into, but I can post more about it if people are interested.

Later on I'll get into the other important aspects of the WebKit engine, such as the
plugins, JavaScript, DOM access, and a few others.

Please feel free to post questions and your thoughts about JWebPane!

Related Topics >>



This project is dead isn't it?

Good. I hope you are close to resolving the licensing / marketing and we can see JWebPane released soon!

It's Oct 2009 and where is JWebPane?

no sign of JWebPane.

Yes, I'm going to have a session (BOF actually) about JWebPane and going to put all the related materials to public resources. Here is the details about the BOF.
BOF-3992 Meet the Team Behind JWebPane, and Learn Advanced Tips and Tricks Thursday June 04 8:30 PM - 9:20 PM

any updates

at all on JWebPane... so many projects ready for this (kiosk based)....

Any possibility of JWebPane seeing the light of day? Are you still going to have a session about it at the upcoming JavaOne conference? I can't make it this year but I would like to see the slides if they could be made available.

I hope that recent Oracle/SUN event won't stop JWebPane release date (soon I hope too), as JWebPane has a great, may be huge, potential for mixing Java+HTML strengths on the client side, and then, may positevily impact Java on the client-side.

We are all waiting excited!!

I was hoping JWebPane might magically appear in the just released JavaFX 1.2, but no :( Here's hoping it's announced as a separate download as part of the Thursday BOF.

Very good project ! I very much look forward to this project, becouse JDIC working not good!

Sooner JWebPane will be released, better it would be. JWebPane will be an important component for Java, and a good news for SUN If you like, read my detailled arguments here:

What are the marketing reasons that are holding up the release? Could you roughly tell us when it will be released? Will it be a separate product / library / framework or will it be shipped with Java 7?

> Can you comment on whether JWebPane will be able to support 64-bit. Java 1.6 on the Mac is 64-bit only. The other projects that have attempted something similar all choke because the JNI bindings and libraries are 32-bit.

JWebPane uses 64-bit native library with jdk6 (64bit) on MacOS.

Unfortunately, we didn't release JWebPane, so far however working with marketing on this.

If JWebPane has been released then where is it at? What's the URL for the project page and the download of it?

I just noticed that JWebPane was finally released... Good news!

I'll chime in with one comment, which is that it would be nice if all these different HTML rendering projects could decide on a common API, so that we didn't need to write reasonably large amounts of code to adapt each slightly different one into an application. Case in point, when we embedded Cobra, almost all the code changed compared to embedding JEditorPane. I guess in the ideal scenario, I would want to be able to use JEditorPane still, but have the UI *behind the scenes* actually use Cobra / WebKit / whatever to render it.

Sorry I have no exact dates so far. Concerning javascript: we have ability to execute arbitrary javascript on the page. So, I suppose you can achieve the same effect with JWebPane.

Hi, I have a couple of questions: 1) Is there any forecast for the availability of the JWebPane component? 2) In QT 4, with WebView component that "wraps" WebKit, I can add to the javascript window object an object from my embedding application that exposes some methods and properties that can be access by javascript from the loaded html page. The way is: WebView->page()->mainFrame()->addToJavaScriptWindowObject("someObjectName", myAppObject); I'm wondering if JWebPane will have a similar feature. Thanks, Luca.

Ok, here's another reason why I believe Sun should be releasing JWebPane now: Genuitec. They just released the SWT version of their Webkit browser, and the Swing version is due out early next month. You wouldn't want them to steal the thunder, would you? :-)

Hi Alexey. 3 months later, could you post any update of the WebPane project? tx

Alexey, it would be very helpful if you could give some sort of a timeline around the release of the code. Realistically, what are we talking about - JavaFX 1.5? Java SE 7? In the absence of a preview release of JWebPane, it is extremely difficult for us to visualize how this API will eventually turn out. At our company, we have currently ruled out Flex (due to the lack of a browser component) and Adobe AIR (due to its desktop-based deployment model, and lack of applet support) for our HTML-centric application. We see JWebPane as a fantastic candidate to replace these other technologies, but until we can do a working prototype, its a case of "no pudding, no proof". Could you please clarify?

I am looking for a way to render XHTML inside a swing JPanel I did not find any JWebPane in JavaFX 1.1 when will JWebPane be released ? would that JWebPane component help me with what I need to achieve ? regards patrick

Ok, so it's a marketing decision to not release this now. Is there any chance that marketing could give us a date on when we can use the JWebPane? Once it was supposed to be ready for JavaFX 1.0, then it was a couple of months later, then it became "near future", and that's a long time ago. I'm sure the JWebPane has become a lot better in the meantime, but is it responsible of Sun to talk about and semi-promise this component for such a long time and then nobody has an idea when it will be released?

smokingrobot, you probably didn't see all but 2 comments initially because archives are a braindead. If you viewed this blog post from a google search and got, you get the archived version with the only 2 comments when it was archived. This confused me and I initially thought that hardly anyone was interested in JWebPane and that there hadn't been any updates or response from the developers.

Bugger for some strange reasin I did not see the comments below, gues you can ignore my previous post....

Alex can you give the Java world an update? When will see more and when might we see some source code... Can you also shed some light on when this will be released? Will it be Java 7 / Java FX or during an update? I think many people are interested in this feature so the sooner the better ;) Thanks Ryan

No, exact date so far. We've solved all the license questions related to the code. Currently, waiting for marketing decision concerning the project.

hi alexey, do you have any update/info to share with us on when jwebpane will be available ?

This is a project I'd really like to know the status, since we are currently working on a project due to release in June and would be thrilled if we could use JWebPane. This project is way more important than JavaFX. Here is what it needs to due though. a) capture drag-and-drop events. b) embedded flash video content. c) GWT d) Run with Java 1.5 currently installed on Mac OS X 10.5 and 10.4. I'm a bit confused about which JVMs JWebPane will run on. It is a 1.6 only project, or can we get it for 1.5 also? While I agree with the previous post about not "rushing it out the door", we have a really need for it soon.

Great fantastic project. Don't let people make you rush it out the door. Much better that when it shows up to the party , it's right and solid. Release something focused in functionality and dependable and that will change the game for a lot of people and draw a lot of people to JavaFX. We ALL needed it yesterday. Popping in here and giving us updates helps immeasurably with resource planning. Will it be able to display (reparse and display without flickering) rapidly changing *text* content? Can I change the text in it continuously without giving it fits? Many thanks and take your time.

I just wrote a rather long rambling blog post today outlining why we need - as it turns out- JWebPane to help both help Swing/SWT/JFace developers - and unify UI development work on the Java Platform: - So good luck releasing something soon so we can all play with it! :) IMHO JWebPane is way way more important than JavaFX!

We're working on opening the code but as I said it's not only engineering effort. So, I still don't have exact time frame for this.

I would agree with others, more information on status would be helpful. Please open up the code so that we can help.

I agree that not knowing makes it difficult to plan. If JWebPane will not be implemented officially, then can you put what has been done into a open source project so that the community can pick it up? From there I sure a useful comonent will be finished given the interest in it.

Second that opinion by coffeejolts, what's going on ? Everybody has been waiting for this forever and first Artam Ananiev comes out with a couple of blog posts for a long time ago and nothing happens, then you come out with this post and again time just goes on and nothing happens... I'm sure there's a good reason for the delay, but how about letting all of the developers desperately waiting for this component know something !!!!

This needs to be released very very soon. I'd thought Sun had scrapped the idea until I read your blog post.

JWebPane has ability to execute custom javascript from JWebPane on the loaded page. So, I think it's possible to implement first scenario for

Please clarify whether the following will be possible. Suppose a developer-customizable page is loaded into a JWebPane, say one from an SaaS web site, e.g., As a Salesforce platform developer, I am free to add a custom button to a page and specify the Javascript to execute when clicked. Will it be possible for the executed Javascript to directly interact: with the JWebPane by way of an implicit Javascript object inserted into the Javascript context by the JWebPane itself? If not, will it be possible for the JWebPane to directly detect that the button I added has been clicked? At the very least, can a JWebPane be programmed to listen for a particular DOM change event - a DOM change event that the added button's executed Javascript causes?

I have been using JEditorPane and HTMLKit to display online views of forms which have images, links etc. It would definitely be very cool to open external web pages without having to launch a browser. If we could open Adobe Reader restricted within that window some that I can have an advanced PDF viewer integrated that would be awesome too. Obviously I can launch Adobe but that is not the same as having it contained within a dialog or frame. Remember release early, release often and I think you will find a great deal of interest.

>I always want to know about the licensing concerning Webkit open source project. Can more be elaborated on the licensing issue consider that WebKit is open-sourced ? It will be interesting to know about the business point of thing and not just from technological perspective.

Webkit has LGPL and BSD licensed code as was mentioned in liquid's post and I don't have much to add concerning Webkit licensing. Moreover, we don't have much choice in selecting browser engine. There is just a few up-to-date high quality open source browser engines and Webkit among them.

> 1) will it be possible to set up a http proxy server for each component instance / set of instances?
We're using for networking, so the only proxy settings for whole JVM is possible.
> 2) Will it be possible to set up custom sources for processed urls? As in JWebPane asks my code for url http://xxx/ , my code gives it InputStream to read from?
Currently we have simple policy mechanism for handling processed urls. It allows to accept/reject urls, but not rewriting them. But it seems to be nice feature to have, so we will consider such extension of our api.

alex2d , I think the team make a good choice of not reusing JDic Plus but rather develop from the webkit work since it seems that WebKit has become the defacto standard for cross-platform browser component (eg flex, apple) and beside, JDic's browser components, like most free web browser Java components tend to suffer from "showstopper" stability and reliability problems despite ongoing fix (from personal experience and forum). Hence a new endeavour based on another promising technology will a be a refreshing start. From marketing perception, it is a good move too to use the fast growing WebKit technology especially Apple is providing free publicity and promotion of Webkit technology based on its Safari browser and iPhone. I always want to know about the licensing concerning Webkit open source project. Can more be elaborated on the licensing issue consider that WebKit is open-sourced ? It will be interesting to know about the business point of thing and not just from technological perspective.

I'd like to point out that at the beginning of this project we were considering to reuse JDIC or JDIC plus but because of some limitations of these projects decided not to use them and base the work on WebKit engine. Main disadvantage of the JDIC is that it's heavyweight. The improved version (JDIC plus) is not, but working only on windows.

I read it,i dont understand...Please, show me. I'm student,Vietnamese and beginner. Thank you, very much.

I need it pretty much yesterday ;\ Two questions - 1) will it be possible to set up a http proxy server for each component instance / set of instances? 2) Will it be possible to set up custom sources for processed urls? As in JWebPane asks my code for url http://xxx/ , my code gives it InputStream to read from? I have a project I'm working on where I will have to have some means of intercepting / modifying htmls (and probably other things accessed via http).

Hi Alex, We're currently using the JDIC web browser component. Needless to say, the JDIC browser component is buggy and the semantics are different on Windows and Mac platforms. We have made some modifications to get it to work. We'll be happy to get rid of it. I saw the JWebPane demo last year at J1 and walked away really impressed. I'm looking forward to the day when JWebPane is released. Keep up the great work. --Mark

>We even have flash support on windows (using flash windowless ActiveX control) that doesn't break the lightweight property of the component.


Also, I'd like to mention here that JWebPane is a swing component that represents html content. It doesn't (and actually don't need to) have browser like UI (address bar, status bar ...). But It has api capable enough to create all of these and more.

JWebPane is a lightweight component. As I showed at the scheme all the rendering is done by Java2D. So, yes it can be rendered on some other graphics or image. We even have flash support on windows (using flash windowless ActiveX control) that doesn't break the lightweight property of the component.