1

I would like to know the best way and what it would require(languages/libraries) to generate Java GUI code from an HTML page with embedded Javascript code. It would emulate the HTML objects(like divs/tables) and their interactions. I don't need to emulate any complicated Javascript libraries, but just get basic functionality like handling mouse clicks/movements and key presses which Java can easily support.

I was thinking of representing all of the HTML objects using absolute positioning in Java without having to generate code for layout managers.

EDIT: Regarding seand's comment: I meant that I don't need to convert code written in JQuery or other Javascript libraries into Java GUI code. I only want to deal with simple Javascript.

4
  • 6
    I wish you lots of luck with this one. Commented Apr 10, 2012 at 15:52
  • 2
    And here I was lamenting the problems with absolute positioning and wishing that HTML had Java-style layout managers… Commented Apr 10, 2012 at 15:59
  • I proposed an edit to your question but it was rejected by @HovercraftFullOfEels... I think you meant to say "I don't need to emulate any complicated Java libraries"? If not, please clarify, because it doesn't make sense to me. Commented Apr 10, 2012 at 19:37
  • Chances are slim for making this work. How about embedding the HTML into a Swing application? There's been plenty of work towards making this possible, could this work for you? Commented Apr 10, 2012 at 22:30

1 Answer 1

1

I was searching as well and it appears that nothing seems really meant to do that.

However one option is to embed a browser into your app using something like:

http://djproject.sourceforge.net/ns/
http://www.eclipse.org/articles/Article-SWT-browser-widget/browser.html

And then used it to load your HTML pages.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.