The Source for Java Technology Collaboration
User: Password:



Alexey Ushakov

Alexey Ushakov's Blog

JWebPane project, a browser plugin for Swing and soon FX

Posted by alex2d on December 10, 2008 at 04:08 AM | Comments (70)

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 java.net 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!


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • > Does JWebPane allow access to the DOM of loaded pages? Is it possible to listen for events (clicks etc.) for recording test cases of web applications and e.g. "click" on DOM elements for playback?

    Currently, the only way to get this information is through executing of custom javascript code on the loaded page. Also, now we don't provide hooks for developer's code to be able to listen to DOM events. However, the work is in progress and we're going to provide direct DOM access and custom DOM event handling by the release time.

    Posted by: alex2d on June 23, 2009 at 02:44 AM

  • Does JWebPane allow access to the DOM of loaded pages? Is it possible to listen for events (clicks etc.) for recording test cases of web applications and e.g. "click" on DOM elements for playback?

    Posted by: maikmerten on June 22, 2009 at 08:33 AM

  • It would have been nice to at least have a beta release this summer so the developer community could have something to try out and give feedback. It is unfortunate to see that is not happening and the release now being some undetermined date with only suggestions of the end of year. If it is marketing is holding up the release then that is a truly bad marketing strategy.

    Posted by: jlbaumga on June 09, 2009 at 05:32 AM

  • Here's the status: http://explodingpixels.wordpress.com/2009/06/05/jwebpane-update/ Wow, end of the year (maybe). Who knows whether it will be released at all at this point. What a major f... up. Great way to treat Java developers with this stall-and-delay tactic. Of course this announcement of JWebPane has delayed or canceled similar project that others were working on.... I agree with dlemmermann below, you should remove this post. Thanks for wasting my time.

    Posted by: gath55 on June 08, 2009 at 04:49 AM

  • So what happened at yesterday's BOF?

    Posted by: luisa081 on June 05, 2009 at 11:45 AM

  • This was announced last Java One and still hasn't seen the light of day. Duke Nukem Forever was recently cancelled, I declare JWebPane to be the new Duke Nukem Forever.

    Posted by: jleech on June 05, 2009 at 10:27 AM

  • 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.

    Posted by: george_hawkins on June 02, 2009 at 08:49 AM

  • "related materials" = slides? PDFs? Will there be a release or not?

    Posted by: dlemmermann on May 29, 2009 at 10:41 AM

  • Are we going to see a real release for JavaOne ? I hope so.

    Posted by: dmdevito on May 28, 2009 at 06:57 AM

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

    Posted by: jlbaumga on May 12, 2009 at 08:53 AM

  • 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

    Posted by: alex2d on May 12, 2009 at 02:31 AM

  • 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.

    Posted by: jlbaumga on May 11, 2009 at 03:19 PM

  • This post should be removed. It only damages Sun's reputation because it announces something that isn't ready to be announced, yet. Some companies might actually start building products that depend on this component and its availability.

    Posted by: dlemmermann on April 30, 2009 at 02:54 AM

  • 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.

    Posted by: dmdevito on April 22, 2009 at 05:51 AM

  • We are all waiting excited!!

    Posted by: svenmaster on April 22, 2009 at 04:21 AM

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

    Posted by: lyambda on April 14, 2009 at 12:16 AM

  • 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: http://www.jroller.com/dmdevito/entry/hotjava_may_come_back_due

    Posted by: dmdevito on April 13, 2009 at 01:24 AM

  • 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?

    Posted by: dlemmermann on April 07, 2009 at 07:12 AM

  • > 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.

    Posted by: alex2d on April 07, 2009 at 06:30 AM

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

    Posted by: alex2d on April 07, 2009 at 06:25 AM

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

    Posted by: jlbaumga on April 03, 2009 at 07:17 AM

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

    Posted by: plaxiglas80 on April 01, 2009 at 10:22 AM

  • 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.

    Posted by: trejkaz on March 19, 2009 at 07:13 PM

  • Hi Alexey, 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.

    Posted by: plaxiglas80 on March 19, 2009 at 10:08 AM

  • 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.

    Posted by: alex2d on March 17, 2009 at 03:42 AM

  • 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.

    Posted by: lviggiani on March 17, 2009 at 03:16 AM

  • 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? :-)

    Posted by: vjsr71 on March 11, 2009 at 01:19 AM

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

    Posted by: jmau on March 10, 2009 at 11:21 AM

  • 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?

    Posted by: vjsr71 on March 09, 2009 at 12:01 AM

  • 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

    Posted by: boulaypa on March 07, 2009 at 12:18 AM

  • 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?

    Posted by: gath55 on March 06, 2009 at 01:50 AM

  • smokingrobot, you probably didn't see all but 2 comments initially because java.net archives are a braindead. If you viewed this blog post from a google search and got http://weblogs.java.net/blog/alex2d/archive/2008/12/jwebpane_projec.html, 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.

    Posted by: jleech on March 02, 2009 at 03:51 PM

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

    Posted by: smokingrobot on February 26, 2009 at 04:28 AM

  • 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

    Posted by: smokingrobot on February 26, 2009 at 04:24 AM

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

    Posted by: alex2d on February 24, 2009 at 05:57 AM

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

    Posted by: liquid on February 23, 2009 at 02:47 AM

  • 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.

    Posted by: ranul on February 02, 2009 at 11:31 AM

  • 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.

    Posted by: swv on February 02, 2009 at 10:50 AM

  • I came here via the article "How Sun could fix Swing and promote innovation and unification in the UI space" [1]. And I agree with its conclusion: JWebPane could be *the* UI environment for desktop Java, with a brilliant option to go web app at any time via GWT. This would make the Java UI space quite future proof (as browser development is very dynamic at the moment). The only caveat at the moment is that HTML/CSS layout sucks badly for applications. One more thought: However you handle threading, be sure not to fail silently (like Swing), but to throw exceptions (like SWT). [1] http://macstrac.blogspot.com/2009/01/how-sun-could-fix-swing-and-promote.html

    Posted by: rauschma on January 31, 2009 at 02:57 PM

  • 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: http://macstrac.blogspot.com/2009/01/how-sun-could-fix-swing-and-promote.html - So good luck releasing something soon so we can all play with it! :) IMHO JWebPane is way way more important than JavaFX!

    Posted by: jstrachan on January 30, 2009 at 05:43 AM

  • 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.

    Posted by: alex2d on January 26, 2009 at 09:36 AM

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

    Posted by: bcchun on January 25, 2009 at 05:45 PM

  • 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.

    Posted by: sheatrader on January 14, 2009 at 01:16 PM

  • 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 !!!!

    Posted by: gath55 on January 12, 2009 at 01:01 AM

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

    Posted by: coffeejolts on January 11, 2009 at 05:39 PM

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

    Posted by: alex2d on December 19, 2008 at 09:22 AM

  • 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., Salesforce.com. 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?

    Posted by: lpederson on December 16, 2008 at 08:11 PM

  • 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.

    Posted by: caultonpos on December 16, 2008 at 06:42 AM

  • >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.

    Posted by: alex2d on December 15, 2008 at 04:19 PM

  • > 1) will it be possible to set up a http proxy server for each component instance / set of instances?
    We're using java.net 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.

    Posted by: alex2d on December 15, 2008 at 03:50 PM

  • 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.

    Posted by: geekycoder on December 12, 2008 at 10:07 PM

  • 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.

    Posted by: alex2d on December 12, 2008 at 12:56 PM

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

    Posted by: ocbuuvang on December 12, 2008 at 01:04 AM

  • 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).

    Posted by: lilianne_blaze on December 11, 2008 at 03:02 PM

  • 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

    Posted by: davidson1 on December 11, 2008 at 02:15 PM

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

    Excellent!

    Posted by: prunge on December 11, 2008 at 01:51 PM

  • 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.

    Posted by: alex2d on December 11, 2008 at 01:03 PM

  • 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.

    Posted by: alex2d on December 11, 2008 at 11:34 AM

  • Well, this is a little disappointing. It's been done before, Webkit's bsd/lgpl2/lgpl2.1 has little to no impact on the license you choose. Google's Chrome is under BSD for instance, Adobe's AIR is proprietary, and Android under Apache2. So any of these two licenses would obviously work, and up to the protective gplv2 + classpath exception ( + exception if its license is not already compatible with the gpl) which would also take care of it. I guess we'll just wait (or use FlyingSaucer).

    Posted by: liquid on December 11, 2008 at 08:29 AM

  • What happened to flying saucer? https://xhtmlrenderer.dev.java.net/

    Posted by: heaththegreat on December 11, 2008 at 07:17 AM

  • Hi Alexey, Important update ofr all. Will this get the same level of support that JDICPlus got? Seems that was released and soon after Sun stopped supporting that project. Hate to see this effort stop with no explanation.

    Posted by: tdanecito on December 11, 2008 at 07:08 AM

  • We're working hard to make the project public. But it's not only engineering effort. We're also solving some license questions concerning usage of third party open source code (WebKit). Also, there are some issues concerning redistributing third party libraries which JWebPane depends on. So, even binary-only distribution will not help much to avoid all of this.

    Posted by: alex2d on December 11, 2008 at 01:00 AM

  • I want to run a JWebPane full screen with no address bar, buttons, status bar, etc. Just the web page. I need to know when a user clicks links and which URL it was so I can intercept and maybe close the browser window.

    Posted by: rdelaplante on December 10, 2008 at 09:49 PM

  • Looking forward to using JWebPane. Will it be a heavyweight or lightweight component? From the diagram, it looks like Webkit rendering will be done by Java2D - does this mean it will be lightweight? Will it be possible to paint the component to other graphics contexts apart from the screen? (e.g print using Java printing API, save as image with Image IO, save as SVG using Batik...)

    Posted by: prunge on December 10, 2008 at 01:35 PM

  • Thank for the update of status of JWebPane. Yes, many will be glad to know more about the internal architectures of JWebPane and how it works, so do discuss about it frequently. Will there preview feature for JWebPane (like IE/Firefox etc)? So is there a specific timeline for JWebPane's release and beta ? I working on some projects using a third-party embedded browser and will love to use JWebPane.

    Posted by: geekycoder on December 10, 2008 at 10:57 AM

  • I'm not sure if anyone thought about this idea ... I think we should have swing markup documents or SML (just like html documents) which are rendered by Java Swing browser. This browser should have two components - network part and layout engine. Just like traditional web application, we should keep actual processing on server side and let client be minimal. We could get / post SML documents ...these documents could be generated by jsp / servlet. I think this could be useful technology ...

    Posted by: mohdejaz on December 10, 2008 at 10:31 AM

  • can we have binaries before the code is released - so you'll have tests, bug reports and api feedback right now ? or do we still have to wait to try it, and yourself have to wait for months to get real usage feedback ?

    Posted by: liquid on December 10, 2008 at 09:18 AM

  • I'm also very excited about JWebPane. You pretty much can't blog enough about this. Is there any way we could get a "preview" release. I don't care how buggy it is, I just want to start poking at it. Thanks, Collin

    Posted by: aberrant on December 10, 2008 at 08:57 AM

  • I suppose that we will open the code within couple of months or so. Also, I'm going to give some overview of the api before the opening. We actually have some mechanism of handling loading events and permission requests provided by WebKit engine. I'll provide more info about this in the next posts.

    Posted by: alex2d on December 10, 2008 at 06:25 AM

  • Alexey, I'm definitely excited about this. The native dependency is a little annoying, but understandable. Is there any chance we can at least get a sneak peek at the API? I'm especially interested in the level of control Java code can have in handling events from the browser. How soon is the "near future"?

    Posted by: darevay on December 10, 2008 at 05:44 AM



Only logged in users may post comments. Login Here.


Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds