Documentation

The Java™ Tutorials
Hide TOC
Java AppletsJava小程序
Trail: Deployment

Lesson: Java Applets课程:Java小程序

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.JAppletThe 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控制面板中的安全级别设置设置为高或非常高时,本地小程序将被阻止。


Note:注意: To run the applets, use IE mode on Microsoft Edge.要运行小程序,请在Microsoft Edge上使用IE模式。See Microsoft Edge + Internet Explorer mode: Getting Started guide.请参阅Microsoft Edge+Internet Explorer模式:入门指南

Note:注意:  Please make sure you have at least Java SE Development Kit (JDK) 6 update 10 release on your client machine before proceeding further.在继续之前,请确保您的客户机上至少有Java SE开发工具包(JDK)6更新10版本You will need this to view the sample rich internet applications and read subsequent sections without interruptions.您将需要此文件来查看示例富internet应用程序,并在不中断的情况下阅读后续章节。

Previous page: Table of Contents
Next page: Getting Started With Applets