devxlogo

Tip Bank

Dictionary Has Advantages Over Collections

The Dictionary object can contain items, which can be any form of data, just like a collection. However, the Dictionary object has many advantages over a collection. It allows retrieval

Display Two Fields

Let’s say you want to bind your listbox to a recordset, but you also want to display two fields concatenated together, such as “Jones, Barbara.” You can do this by

Encrypt a String Easily

This quick and dirty encryption/decryption function takes whatever string you pass it, assigns it to a byte array, Xor’s each byte by a constant, then returns the string. The offsetting

Avoid Gigantic Classes

Several small and specialized classes are preferred to a single bulky class that contains hundreds of member data members and member functions. More than once I’ve seen programmers extending a

Specifying Position When Adding Components

The java.awt.Container class provides a number of different overloaded versions of the add() method which are used to add components to the container. The integer value specified with the add(Component,