Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the syntax of Java Applet?

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces what Java Applet grammar is like, the content is very detailed, interested friends can refer to, I hope it can be helpful to you.

Introduction to Java Applet

Java Applet are small applications written in the Java language that can be embedded directly into web pages and can produce special effects. Web pages that contain Java Applet are called Java-Powered pages, and can be called Java-supported pages.

When a user visits such a web page, Java Applet is downloaded to the user's computer for execution, but only if the user is using a web browser that supports Java. Because Java Applet is executed on the user's computer, its execution speed is not limited by the network broadband or MODEM access speed, and users can better appreciate the multimedia effects produced by Java Applet on the web page.

In Java Applet, it can realize the functions of graphic drawing, font and color control, animation and sound insertion, human-computer interaction and network communication. Apple also provides a variety of window environment development tools called Abstract window Toolkit (AbstractWindowToolkit,AWT), but the design of AWT is flawed. The Swing technology is replaced by the lightweight build of JavaGUI. Using the GUI elements of the user's computer, they can establish a standard graphical user interface, such as windows, buttons, scroll bars, and so on. At present, there are many Java Applet examples on the Internet to vividly demonstrate these functions.

Description

Provides the classes necessary to create a Java Applet and the classes that Java Applet uses to communicate with its Java Applet context. The Java Applet framework includes two entities: Java Applet and Java Applet context. Java Applet is an embeddable form (see the Panel class) with several additional methods for initializing, starting, and terminating Java Applet in the Java Applet context. The Java Applet context is the application responsible for loading and running Java Applet. For example, the Java Applet context might be a Web browser or a Java Applet development environment.

Summary of construction methods

Java Applet () constructs a new Java Applet.

Method summary

Void destroy () is called by the browser or Java Appletviewer, informing the Java Applet that it is being recycled and that it should destroy any resources assigned to it.

AccessibleContext get AccessibleContext () gets the AccessibleContext associated with this Java Applet.

Java Applet ContextgetJava AppletContext () determines the context of this Java Applet, which allows Java Applet to query and affect the environment in which it runs.

StringgetJava AppletInfo () returns information about this Java Applet.

Audio ClipgetAudioClip (URLurl) returns the AudioClip object specified by the URL parameter.

Audio ClipgetAudioClip (URLurl,Stringname) returns the AudioClip object specified by the URL and name parameters.

URL getCodeBase () gets the base URL.

URL getDocumentBase () gets the URL of the document embedded in this Java Applet.

Image getImage (URLurl) returns an Image object that can be drawn to the screen.

Image getImage (URLurl,Stringname) returns an Image object that can be drawn to the screen.

Locale getLocale () gets the locale of the Java Applet.

String getParameter (Stringname) returns the value of the parameter specified in the HTML tag.

String [] getParameterInfo () returns information about parameters that this Java Applet understands.

Voidinit () is called by the browser or Java Appletviewer to notify the Java Applet that it has been loaded into the system.

Boolean is Active () determines whether the Java Applet is active.

Static AudioClipnewAudioClip (URLurl) gets the audio clip from the given URL.

Void play (URLurl) plays the audio clip at the specified absolute URL.

Void play (URLurl,Stringname) plays an audio clip, given the URL and the relative specifier.

Void resize (Dimensiond) requests that this Java Applet be resized.

Void resize (intwidth,intheight) requests that this Java Applet be resized.

Void setStub (Java AppletStubstub) sets the stub for this Java Applet.

Void showStatus (Stringmsg) requests that the parameter string be displayed in the status window.

Void start () is called by the browser or Java Appletviewer, informing the Java Applet that it should start execution.

Void stop () is called by the browser or Java Appletviewer, informing the Java Applet that it should terminate execution.

Note: the IE browser that comes with windowsXP does not support java.Java Applet.

About how Java Applet grammar is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report