Globale linker

Book 1

Book 2

Book 2 Ch. 6 Java Applets

Java is a programming language derived from C++. This cross platform model for business applications can be distributed on the Internet and run entirely on the client side.

Object-oriented means that a program can be created once and reused (with some modifications) any number of times. Java is an object-oriented programming language, and the Java applet is an object you plug into your web page.

Java min-applications (hence the name applets) are ideally suited to the Internet because they can run on a variety of operating systems, hardware platforms, and web browsers. The same applet can be executed on different systems without being recompiled.

Because Java applets are platform-neutral, all that is required to run them is a Java enabled web browser. Applets are embedded in HTML pages for web viewing.

Java applets are small, fast, multithreading and runs on the client-side. Multithreading allows more than one thread of execution, where each thread is a separate process within a document. One thread might handle user interactions, while another carries out a computation.

You need two pieces of information to insert applets into your web pages.

You embed applets with the <object>-tag (Older browsers must use the deprecated <applet>-tag). The <applet> tag identifies the name of the file to load and run. Like the <img> tag, which uses attributes to pull the image into your page, applets use the «code» attribute to reference the location of your Java applet file. Java applet files are always .class files. Two other attributes required by the <applet> tag are «width» and «height» to tell the browser how much space the applets need to display.

The parameters of the applet are passed to the class using the <param> tag. All <param> tags are place between the opening and closing <applet> tag. For each parameter of the applet, another <param> tag is required.

One of the limitations of Java applets is that the whole applet file must be downloaded before it can begin execution. Java have no streaming capabilities and have no caching capability, which means it must be downloaded upon each subsequent visit to the site.

Many forms of animation can be executed with Java. To update the screen many times per second, you must create a new thread that contains an animation loop. The animation loop keeps track of the current frame and requests periodic screen updates.

Java applet authoring tools include:

Chapter 5 Book 2 Chapter 7 Book 2