devxlogo

Tip Bank

DevX - Software Development Resource

StringTokenizer

Question: After: StringTokenizer st = new StringTokenizer(line); Do I have to write: String key = new String(st.nextToken()); or is it enough to write: String key = st.nextToken(); Answer: It is

DevX - Software Development Resource

Environment Variables

Question: How do I access environment variables? Answer: There is an undocumented method in java.lang.System with the signature: public static String getenv(String) You can use this method to fetch the

DevX - Software Development Resource

Coming Events

If you are extending an AWT Component, such as a Canvas to write your own control, then you will probably want it to trigger events that the super class does

DevX - Software Development Resource

Overloading postfix and prefix ++

For primitive types the C++ language distinguishes between ++x; and x++; as well as between –x; and x–;For objects requiring a distinction between prefix and postfix overloaded operators, the following

DevX - Software Development Resource

Assignment operator is not inherited

Unlike ordinary base class member functions, assignment operator is not inherited. It may be re-defined by the implementer of the derived class or else it is automatically synthesized by the

DevX - Software Development Resource

Tame Truncated Text

You may notice that the first or last character in a Label’s text can get partially chopped off by some implementations of the Java Virtual Machine. Older versions of browsers

DevX - Software Development Resource

Manage the Margins

LayoutManagers control the locations of AWT Components, such as Labels, Buttons and TextFields within Containers, such as Frames, Applets and Panels. Some of the five LayoutManagers included with Java 1.1

DevX - Software Development Resource

C++ (MFC)

Question: I am a student learning to do C++ programming with MFC. I have used InvalidateRect to update a particular area in a program. I thought invalidating reduced the flickering

DevX - Software Development Resource

Casting CDECL_ to an int*

Question: Is there any way of casting the CDECL_ type to *int? Answer: No, because CDECL_ is not a type. It’s a calling convention. Calling conventions specify how arguments are