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

2022-01-24 00:00:00 browser java swing jframe webswing

我开发了一个大型摇摆应用程序.有几个类,每个类都创建自己的 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 浏览器中,并了解我需要将其转换为小程序.我是否必须在每个类中添加用于创建小程序的代码?还是有其他方法.

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 服务器,添加的应用程序 Swing 窗口将出现在您的浏览器中 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

相关文章