devxlogo

Tip Bank

Delete the Contents of a List

This technique allows you to delete the contents of a List at the same time you are storing pointers a list. This same approach can be used for maps or

Pointer to a Constant vs. Constant Pointer

The const keyword in C++ provides a type-safe way to replace some of those #define preprocessor statements that you’re used to writing from C.Whenever you have a value that you

Listening to All AWT Events

For some programs, it is helpful to create a listener to keep track of all the events being dispatched by the UI. This can be very useful in debugging programs.

Adding a Timer to Your Application

Java swing provides a Timer class to cause an action at a pre-defined rate. For instance, you could have a label that blinks at a pre-defined rate. The class has

Sending HTML and ASCII Formatted E-mails

To do this, you need the javax.mail package. It’s a part of J2EE and available from java.sun.com.Sending a simple e-mail is pretty easy: import java.util.Properties;import javax.mail.*;import javax.mail.internet.*;public class Mail {static