JFrame on website

强颜欢笑 提交于 2019-12-12 04:44:31

问题


I have an application which is composed of many JFrame objects (using Java and Netbeans). The 'main' frame has 4 buttons and each button opens another frame. Now my problem is that I want the whole application to be run on the web as a website.

I was considering 3 possible scenarios (from my research):

  1. Use Java Web Start
  2. Convert JFrame to JApplet
  3. Create from scratch a Java web application

I was hoping that maybe someone can give me some help, and guidelines of which option I should opt for.


回答1:


The quickest option is to modify your application to run as an applet (yes, this would involve making a JApplet from your JFrame). However, you should realize that the Java Applet is considered an outdated technology. Most mobile devices won't run them and even some popular desktop browsers won't (Mac Chrome). What's more, Oracle now requires all applets to be signed in order to run with default security settings. This means purchasing a yearly (~$200) signing certificate.

Java Web Start is not really fundamentally different from applets and will suffer the same issues as above.

Think again about your choice of technology. A Java web application (e.g., Spring MVC) or a JavaScript application (e.g., GWT, JQuery) are better choices.




回答2:


For deploying Java desktop apps., the best option is usually to install the app. using Java Web Start. JWS works on Windows, OS X & Unix/Linux.

Applet deployment has always been difficult, with weird bugs in particular versions of specific JREs in conjunction with particular browsers. My 'favorite' bug happened in a version of Firefox that triggered an applet to reload when the user scrolled up in the web page.


See also The Use of Multiple JFrames, Good/Bad Practice?



来源:https://stackoverflow.com/questions/22305095/jframe-on-website

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