6

can I create Gui in html5/JS for the desktop java application. If yes, what tools I need and how would I connect GUI with java code?

1 Answer 1

2

Possible - but not entirely sure why you'd want to do that.

Your main options would be:

  • Have the Java application act as a local web server and connect to it with a browser. Would be a wierd design but fairly easy to make it work. It's essentially the same as you would do if you had a remote Java web server so the components are pretty standard - you could use a toolkit like Vaadin for example.
  • Run JavaScript within a Java hosted environment / embedded browser. Should be possible with Rhino - though I must admit I haven't ever seen this approach used to build a desktop GUI

The first option in particular might make sense if you were considering using the application remotely at some point in the future.

Overall though, I'm still not sure if this is a good idea. The JavaScript web frameworks still aren't IMHO as good as the native Java ones (SWT, Swing or JavaFX) for building local desktop application GUIs.

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.