devxlogo

Tip Bank

Using the EventObject Class

The EventObject class is the base class for transferring events in Java (see Tip “Understanding the Listener Pattern”). It provides these methods: public EventObject (Object source) // Constructor. The “source”

Show a Random Image

A bit of randomness can help keep your Web site from getting stale. You can use the JavaScript rand() function to display random text or a random image. function goRand()

Unconsting a const Variable

There are two types of const data storage: true const and contractual const. const int cn = 5; // true const A contractual const variable is a non-const one, which

Preload Your Images

If you use JavaScript rollover images on your Web pages, it’s a good idea to preload them in order to reduce lag time while the image downloads. Non-preloaded images won’t

Minimize Server Script in Active Server Pages

To improve performance in your Active Server Pages, try to minimize the amount of server script present. From a design point of view, putting extensive code and business rules in