The Java Tutorials have been written for JDK 8.Java教程是为JDK 8编写的。Examples and practices described in this page don't take advantage of improvements introduced in later releases and might use technology no longer available.本页中描述的示例和实践没有利用后续版本中引入的改进,并且可能使用不再可用的技术。See Java Language Changes for a summary of updated language features in Java SE 9 and subsequent releases.有关Java SE 9及其后续版本中更新的语言特性的摘要,请参阅Java语言更改。
See JDK Release Notes for information about new features, enhancements, and removed or deprecated options for all JDK releases.有关所有JDK版本的新功能、增强功能以及已删除或不推荐的选项的信息,请参阅JDK发行说明。
This lesson discusses the basics of Java applets, how to develop applets that interact richly with their environment, and how to deploy applets.本课程讨论Java小程序的基础知识,如何开发与环境充分交互的小程序,以及如何部署小程序。
A Java applet is a special kind of Java program that a browser enabled with Java technology can download from the internet and run.Java小程序是一种特殊的Java程序,启用Java技术的浏览器可以从internet下载并运行该程序。An applet is typically embedded inside a web page and runs in the context of a browser.小程序通常嵌入在网页中,并在浏览器的上下文中运行。An applet must be a subclass of the 小程序必须是java.applet.Applet
class.java.applet.applet
类的子类。The Applet
class provides the standard interface between the applet and the browser environment.Applet
类提供Applet和浏览器环境之间的标准接口。
Swing provides a special subclass of the Applet
class called javax.swing.JApplet
.Swing
提供了Applet
类的一个特殊子类javax.Swing.JApplet
。The JApplet
class should be used for all applets that use Swing components to construct their graphical user interfaces (GUIs).JApplet
类应用于所有使用Swing组件构建图形用户界面(GUI)的小程序。
The browser's Java Plug-in software manages the lifecycle of an applet.浏览器的Java插件软件管理小程序的生命周期。
Use a web server to test the examples in this lesson. The use of local applets is not recommended, and local applets are blocked when the security level setting in the Java Control Panel is set to High or Very High.使用web服务器测试本课中的示例。不建议使用本地小程序,当Java控制面板中的安全级别设置设置为高或非常高时,本地小程序将被阻止。