devxlogo

Tip Bank

Serialize Image Instances

The java.awt.Image class does not implement the java.io.Serializable interface. As a result, attempts to serialize or “marshal” instances of the class will fail. For example, they cannot be passed as

Create Custom Hotkeys in Visual InterDev 6

Visual InterDev 6 installs with its own keyboard mapping scheme, which you can customize to suit your preferences. For instance, you may want to use the F12 key from within

Determine Total and Available Memory

If you find that your Java programs are starting to use too much memory, there are methods available that can help you diagnose how much memory is allocated. The freeMemory()

Determine Absolute Cursor Coordinates

When a component event such as a mouse click occurs, Java provides the cursor coordinates relative to the top left corner of the component in which the event took place.

Friends Should be Declared Public

The compiler ignores the access specifier of friend functions. However, you should declare them as public to make the code readable: bool operator ==( const Date & d1, const Date&

Dynamically Create Selection Box Options

You can create selection box options dynamically using JavaScript 3.0’s Option object. The syntax for its constuctor is: Option(text, value, [default selected], [selected]) Here is an example:

Empty Exception Specification

Some programmers tend to add an empty exception specification to constructor destructor, assignment operator, and copy constructor of a class: class C {public: C() throw(); ~C() throw(); C(const C&) throw();