Advanced HTML (7)Java Applets [Archives:2003/673/Education]
Adnan A. Al-Harazi
NCC Education, Yemen Center
Java can be used to write entire applications just like a conventional programming language. All that is required to run them is a Java interpreter. Java is also very popular for writing applets (small applications). These are intended for use within a web browser and cannot be run as a stand-alone application. Typically applets extend the capabilities of the browser, or provide web site specific functionality.
Java applets are usually very small. This means that they can be downloaded from web sites very quickly. All up-to-date web browsers contain Java interpreters. This allows web sites to use applets in a very flexible fashion. Many web site designers will wish to extend the impact of their web sites by adding such applets.
Java applets are written by using Java language and the only difference between Java applets and applications is that applets don't need the main () method to run. Instead, applets need to use a separate HTML file which works as the spark to run the java applet code. This HTML file can also include the other tags needed for your web site. You will need to insert the “
Notice: the applet file “Myapplet.class” must be saved in the same directory where the HTML file is saved. Many applets are available for free in the Internet. You just download the class file for the applet to the directory of your web site and then add the applet tags to the HTML code.
The result of this script will look like fig 2.
– The compatibility problems are not quite as bad as they might appear, since plug-ins can be used to cover the differences. For example, a VBScript plugin interpreter is available for Netscape Navigator.
A wide variety of other tools and formats are used to create sophisticated web pages. It is not possible to provide a complete review of all of these in a lesson such as this. One of the most used toos is ActiveX.
This is currently a strategic line of development for Microsoft.There is no single product or technique which is `ActiveX'. Originally Microsoft positioned ActiveX as an alternative to Java, and this still persists in some documentation. ActiveX is perhaps better seen as an alternative to plugins.
ActiveX was based originally on Object Linking and Embedding (OLE). This was a simple technology for enabling compound documents; where part of one document can be included or embedded in another. OLE became more complex and general, introducing a standard way for one piece of software to advertise and provide services for another. This required the introduction of the Component Object Model (COM).
– ActiveX undoubtedly provides a rich environment for the web site developer, provided that the primary target platform is Microsoft Windows.
– Microsoft will continue to support and develop ActiveX; it is clearly part of their strategic direction. There is a limitation however, Microsoft Internet Explorer has always provided support for ActiveX, but this is to be expected, since ActiveX is effectively a Microsoft developed standard. The position with other browsers has been less clear and Netscape has not fully supported ActiveX in the same way as Internet Explorer.
If you have any questions about the lessons please send me an e-mail to [email protected]
Next week: More in Advanced HTML