X

Geertjan's Blog

  • April 14, 2014

Can it be true? HTML 4 Java, at last?

Geertjan Wielenga
Product Manager

Two events recently conspired to make me suddenly understand Jaroslav Tulach's most recent amazing project. The first was a comment I received in this blog a few days ago:

I was wondering... why Java is not in a position where it is
using HTML, CSS or Javascript for its GUI? Java Swing has lots of limitations
for UI designers and also it is tedious. Frankly... it is old! Where using HTML
bootstrap, CSS all of the UI requirements are already taken care of.
I know that JavaFX introduced the web browser in Java and sadly attempted to
introduce a FXML style GUI but it is a bit clunky. Bit unnecessary to learn
something new with not much gain!
Why not develop a solution where the front-end of a desktop java application
will use HTML5 and the backend will use good old Java for carrying out bulk of
the work.
Java already has a great reputation... why not combine it with the best of
HTML, CSS and Javascript for desktop applications?

 Now, I must say that I disagree with both points, i.e., re Swing and JavaFX, I think both are great, really great, no reservations on either of them... for the purpose for which they're intended to be used, i.e., for their place in the world, they serve that place well. However, let's leave aside that whole discussion for the moment and focus on the other point made above, that is, that HTML, especially the goodness of HTML5, could be an alternative way to provide a frontend on top of Java on the desktop.

The second event, which really brought the point home for me was an article that came through on Twitter entitled "Creating Desktop Applications With node-webkit". The article lists all the reasons why web applications can suck, e.g., "when using browsers one’s control of the user interface is limited", browser variance, and security issues. And then the Node WebKit is introduced, "to take the pain out of offline single-page application development".

 OK, now I get it. Java on the desktop is great, at last there's a general acceptance of that, as opposed to the continual process of throwing out the baby with the bathwater. However, what both these divergent sources are pointing out is that, in the same way that the Java EE world enjoys having the option of incorporating HTML5 front-ends, let's have the same opportunities for the Java desktop. 

And, with that background, let's take a look at Jaroslav Tulach's latest project. 

Start by cloning from Git, the following:

hg clone -r 7c26d20c0b0f http://hg.netbeans.org/html4j/nb/ 

What you now have 

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.