The learning of applets

Source: Internet
Author: User

Applets are small applications written in the Java programming language, which can be contained in HTML (an application of the standard Universal Markup Language) page, in much the same way as the page contains images.

Applets must be run on a specific "container", either the browser itself or through a variety of plugins, or a variety of other programs, including mobile devices that support applets. Unlike a typical Java application, applets are not run by the main method (see the Hello World program in Java and the Hello World program for Java applets). Applets typically interact with the user at run time, display dynamic footage, and also follow stringent security checks to block potentially unsafe factors (such as restricting access to the client's file system based on security policies).

The HTML file code for the Web page containing the applet has a pair of tags in the middle, and when the Java-enabled web browser encounters this pair of tags, it downloads the appropriate applet code and executes the applet on the local computer. Java applets are small applications written in the Java language that are directly embedded in the page and interpreted by a Java-enabled browser (IE or Netscape) to perform programs that produce special effects. It can greatly improve the interactivity of Web pages and the ability to execute dynamically. Pages that contain applets are called java-powered pages, which can be referred to as Java-supported web pages.

When a user accesses such a Web page, the applet is downloaded to the user's computer for execution, but only if the user is using a Java-enabled web browser. Because the applet is executed on the user's computer, its execution speed is not limited by the network bandwidth or modem access speed, the user can better appreciate the multimedia effect produced by the applet on the webpage.

In the Java applet, it can realize the functions of drawing, font and color control, animation and sound inserting, human-computer interaction and network communication. The applet also provides a window environment development tool called the Abstract Window Toolbox (Toolkit, AWT). AWT uses the GUI elements of the user's computer to create a standard graphical user interface, such as Windows, buttons, scroll bars, and so on. At present, there are many examples of applets on the network to vividly show these functions, readers can go to the corresponding pages to see their effects.

The implementation of applet applets relies primarily on the applet classes in the Java.applet package. Unlike a typical application, an applet application must be embedded in an HTML page to be interpreted and executed, while an applet can get parameters from a Web page and interact with the Web page.

An applet is a Java applet that is run by a Java-enabled web browser by using the applet's HTML file. It can also be run through the appletviewer of Java development tools. The applet program cannot be separated from the HTML file that uses it. The information about applets in this HTML file should contain at least the following three points:

1) bytecode file name (compiled Java file with. class suffix)

2) The address of the byte-code file

3) How to display applets on a Web page.

The learning of applets

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.