Using the background color parameter, the page designer can choose an applet color that works well with the page colors. You'll learn about parameters in Defining and Using Applet Parameters , and about the Component class and drawing in the Getting Started trail. You can compensate by recommending that pages that include your applet specify a little more space than might be necessary, and by using flexible layouts, such as the AWT-provided GridBagLayout and BorderLayout classes, that adapt well to extra space. Applets load images using the Applet getImage methods. The Applet getCodeBase and getDocumentBase methods provide the base URLs that most applets use.
Applets can do several things to decrease the perceived startup time.
The Applet subclass can be a small one that immediately displays a status message. If some of the applet's classes or data aren't used right away, the applet can preload the classes or data in a background thread. For example, the AppletButton class start method launches a thread that gets the Class object for the window the button brings up. The applet's main purpose in doing so is to make sure the class name the user specified is valid. An added benefit is that getting the Class object forces the class file to be loaded before the class is instantiated.