Convert JavaFX desktop app to Web app

拜拜、爱过 提交于 2021-02-08 10:46:28

问题


I have a Maven JavaFX based desktop App and I have to convert it to a dynamic web app in eclipse or any other IDE ( I am using Eclipse Neon-Java EE). I have tried with Project Facets (Right click on project name --> Properties --> Project Facets --> dynamic web app) I have generated Web Content files (Meta-INF and WEB-INF). In the project folder still appears the letter "M" and not the golobe icon. When I try to run it in Tomcat it shows a 404 error.

My project looks like this:

Project Image

Can anybody help me to convert this JavaFX project to run on a browser?


回答1:


you can not simply run a JavaFX application in a browser. Using a Desktop UI Toolkit (like JavaFX) and a web based toolkit (HTML) are 2 completely different technologies.

To be true there are some frameworks that let you run JavaFX views in a browser ( see example here: http://dlsc.com/2015/12/01/cool-javafx-in-the-browser/) but this is not supported.

If you want to have a web application it would be good to reimplement the views by using a modern web framework like Polymer (https://www.polymer-project.org/1.0/), AngularJS (https://angularjs.org) or ReactJS (https://facebook.github.io/react/).

If you do not want to learn JavaScript you should have a look at GWT (http://www.gwtproject.org), Vaadin (https://vaadin.com/home) or Dolphin Platform (https://github.com/canoo/dolphin-platform)



来源:https://stackoverflow.com/questions/39229508/convert-javafx-desktop-app-to-web-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!