如何在Web浏览器上部署Swing应用程序?

如何在Web浏览器上部署Swing应用程序?

问题描述:

我已经开发了一个很大的秋千应用程序.在关闭上一个称为此类的类的同时,有几个类各自创建自己的 JFrame .

I have a big swing application that I have developed. There are several classes that each creates its own JFrame while closing the previous one which called this class.

我希望将其部署到Web浏览器中,并了解我需要将其转换为applet.我必须在每个这些类中添加用于创建小程序的代码吗?还是有其他方法.

I wish to deploy this into a web browser and understand that I need to convert it to an applet. Do I have to add in code for creating applet in each of these classes? or is there some other way.

在我当前的情况下,每个类都创建一个 JFrame ,其中包含一些按钮,单击这些按钮将关闭当前 JFrame 并实例化一个新类,从而创建另一个 JFrame .

In my current situation each of the class creates a JFrame which has some buttons which on being clicked will close the current JFrame and instantiate a new class which creates another JFrame.

能否请您帮我解决我的问题并为我提供建议?

Could you please help me and advice me on how to resolve my problem?

我刚刚使用了以下步骤:

I have just used below steps:

  1. http://webswing.org/
  2. 下载 Webswing
  3. 上传您的jar文件
  4. 将您的应用程序添加到webswing.config并使用Java 8 +
  5. 启动Webswing服务器,添加的应用程序切换窗口将出现在浏览器中的 http://localhost:8080/上默认情况下
  1. Download Webswing from http://webswing.org/
  2. Upload your jar file
  3. Add your application to webswing.config and use Java 8+
  4. Start Webswing server and the added application swing window will appear in your browser at http://localhost:8080/ by default