In: Categories » Computers and technology » JAVA » What should you know before you ship your Java applet ~ The perfectly finished applet
|
Stop! Before you let the whole world know about your applet, make sure the answer to all of the following questions is yes: 1. Have you removed or disabled debugging output? If your applet code launches any threads, then unless you have a really good excuse not to, you should implement the stop method so that it stops and destroys (by setting to null) the threads you launched. boolean frozen = false; // an instance variable public boolean mouseDown(Event e, int x, int y) { The Perfectly Finished AppletThe previous section lists some of the ways you can avoid making your applet's users want to throttle you. This section tells you about some other ways that you can make dealing with your applet as pleasant as possible: 1. Make your applet as flexible as possible. You can often define parameters that let your applet be used in a variety of situations without any rewriting. 2. Make your applet accessible. You can design your applet so that it is accessible to all. 3. Implement the getParameterInfo method. Implementing this method now might make your applet easier to customize in the future. Currently, no browsers use this method. Soon, however, we expect browsers to use this method to help generate a GUI that allows the user to interactively set parameter values. 4. Implement the getAppletInfo method. This method returns a short, informative string describing an applet. Although no browsers currently use this method, we expect them to in the future. Here's an example of implementing getAppletInfo: public String getAppletInfo() {
|
legal disclaimer
1) Our website is not responsible for the information contained by this article as well for any and all copyright infringements by authors and writers. E-articles is a free information resource. If you suspect this article for any copyright infringements, please read the Terms of service and contact us to investigate the problem.
2) The E-articles directory team is not responsible for inaccuracies, falsehoods, or any other types of misinformation this tutorial may contain and will not be liable for any loss or damage suffered by a user through the user's reliance on the information gained here. Please read the Terms of service
Useful tools and features
related articles
You can deploy applets for users of both Internet Explorer and the Mozilla family of browsers in one of two ways: Through pure HTML Through JavaScript Using Pure HTML When using a pure HTML approach to deploy applets in a mixed-browser environment, note the following: 1. Internet Explorer Recognizes the object tag Ignores the contents of the comment tag 2. Mozilla browsers Ignore an object tag with the clas...
2. A Strategy for Defining Immutable Objects in a Java application
The following rules define a simple strategy for creating immutable objects. Not all classes documented as "immutable" follow these rules. This does not necessarily mean the creators of these classes were sloppy they may have good reason for believing that instances of their classes never change after construction. However, such strategies require sophisticated analysis and are not for beginners. 1. Don't provide "setter" methods, methods that modify fields or objects referred to by fields. 2. Make a...
3. The Three Kinds of Exceptions in Java applications
An exception is an event, which occurs during the execution of a program, that disrupts the normal flow of the program's instructions. When an error occurs within a method, the method creates an object and hands it off to the runtime system. The object, called an exception object, contains information about the error, including its type and the state of the program when the error occurred. Creating an exception object and handing it to the runtime system is called throwing an exception. After a method throws an excep...
4. How to use the PATH and CLASSPATH environment variables on Windows Solaris and Linux
This section explains how to use the PATH and CLASSPATH environment variables on Microsoft Windows, Solaris, and Linux. Consult the installation instructions included with your installation of the Java Development Kit (JDK) software bundle for current information. After installing the software, in the JDK directory, the bin directory contains both the compiler and the launcher. Update the PATH Variable (Microsoft Windows NT/2000/XP) You can run Java applications just fine without setting the PATH varia...
Many programmers will never need to implement their own Collections classes. Someday you might want to write your own implementation. It is fairly easy to do this with the aid of the abstract implementations provided by the Java platform. Before we discuss how to write an implementation, let's discuss why you might want to write one. Reasons to Write an Implementation The following list illustrates the sort of custom Collections you might want to implement. It is not intended to be exhaus...
6. How to create a JAR File
The basic format of the command for creating a JAR file is: jar cf jar-file input-file(s) The options and arguments used in this command are: The c option indicates that you want to create a JAR file. The f option indicates that you want the output to go to a file rather than to stdout. jar-file is the name that you want the resulting JAR file to have. You can use any filename for a JAR file. By convention, JAR filenames are giv...
7. What Is a Java Object ~ Advantages of bundling code into individual software objects
Objects are key to understanding object-oriented technology. Look around right now and you'll find many examples of real-world objects: your dog, your desk, your television set, your bicycle. Real-world objects share two characteristics: They all have state and behavior. Dogs have state (name, color, breed, hungry) and behavior (barking, fetching, wagging tail). Bicycles also have state (current gear, current pedal cadence, current speed) and behavior (changing gear, changing pedal cadence, applying brakes). Identifying t...
8. Processes and Threads in Java programming language
In concurrent programming, there are two basic units of execution: processes and threads. In the Java programming language, concurrent programming is mostly concerned with threads. However, processes are also important. A computer system normally has many active processes and threads. This is true even in systems that only have a single execution core, and thus only have one thread actually executing at any given moment. Processing time for a single core is shared among processes and threads through an OS feature called...
9. Steps to follow when writing a custom implementation
The process of writing a custom implementation follows: 1. Choose the appropriate abstract implementation class from the preceding list. 2. Provide implementations for all the class's abstract methods. If your custom collection is to be modifiable, you'll have to override one or more of the concrete methods as well. The API documentation for the abstract implementation class will tell you which methods to override. 3. Test and, if necessary, debug the implementation....
10. How to create view extract and update a JAR file archive
Creating a JAR File The basic format of the command for creating a JAR file is: jar cf jar-file input-file(s) The options and arguments used in this command are: The c option indicates that you want to create a JAR file. The f option indicates that you want the output to go to a file rather than to stdout. jar-file is the name that you want the resulting JAR file to have. You can use any filename for a JAR file. By convention, JAR filenames are given a .jar extensio...










