Use embedded web browser (e.g. Chrome) as GUI toolkit for Java desktop applications?

Mive van Haaven picture Mive van Haaven · Feb 10, 2012 · Viewed 22.2k times · Source

Those HTML5 websites look great - why don't my Java desktop apps do? Swing and SWT are, well, just old-school. They do their job, but to create fancy looking GUIs with animation and everything is merely impossible.

I was wondering: Is it possible to use HTML5 as a GUI toolkit? I'm having a library in mind that has an API similar to Swing or SWT, but renders in HTML5. It should be themable and you should have access the the page in Java (i.e. some fusion between Java and JavaScript/HTML5).

Why not just create a web app and send my users the URL to it? I would like to benefit from real Desktop integration of Java SE apps (Files, COM, Tray Icon etc.). Just something like PhoneGap but for desktop OS'es instead of phones.

Stunningly I did find nothing like that on the web. But maybe I just entered the wrong search terms? Anyone have an idea?

Or if not: Can I somehow embed WebKit/Chrome together with my app? So the user won't have to install its own copy, or change any settings.

Answer

Mike West picture Mike West · Feb 13, 2012

Two things come to mind:

  • Adobe Air, which is more or less exactly what you're looking for: PhoneGap for the desktop.
  • Chromium Embedded Framework, which, with a little effort on your part, would allow you to use Chromium as the frame for an application.