Skip to content
欢迎扫码关注公众号

JEP 289: Deprecate the Applet API | 弃用 Applet API

摘要

弃用 Applet API,因为随着网络浏览器厂商移除对 Java 浏览器插件的支持,它正在迅速变得无关紧要。引导开发人员使用替代技术,如 Java Web Start 或可安装应用程序。

动机

在 Web 浏览器中运行 Java 小程序需要使用浏览器插件。然而,到 2015 年底,许多浏览器供应商已经移除了插件支持,或者宣布了这样的移除时间表。一旦浏览器插件消失,就没有理由再使用 Applet API 了。

描述

向以下类添加 @Deprecated(since="9") 注释:

  • java.applet.AppletStub
  • java.applet.Applet
  • java.applet.AudioClip
  • java.applet.AppletContext
  • javax.swing.JApplet

我们不打算在下一个主要版本中移除 Applet API,因此在这些注释中我们不会指定 forRemoval = true。如果以后我们提议删除此 API,那么我们将在至少一个主要发布版本之前将 forRemoval = true 添加到这些注释中。

appletviewer 工具也将被弃用。当启动该工具时,将在标准错误流中打印弃用警告。

风险和假设

这些注释将导致 Java 编译器针对使用此 API 的所有代码发出弃用警告。如果警告被视为错误,它们将导致构建失败。

Page Layout Max Width

Adjust the exact value of the page width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the page layout
A ranged slider for user to choose and customize their desired width of the maximum width of the page layout can go.

Content Layout Max Width

Adjust the exact value of the document content width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the content layout
A ranged slider for user to choose and customize their desired width of the maximum width of the content layout can go.