devxlogo

Tip Bank

Using Static Imports

This feature is new in the JDK 1.5 and is intended to reduce the Java app verbosity. Static imports allow you to put into scope a set of methods and

Short Expressions

C++ has an alternative for the if condition using the sign “?”. The syntax for this condition is : “condition”?”case true”:”case false”. For example, a function to return the maximum

Save a Round Trip to the Database

Save a round trip to the database when a keyed item is selected from any list type. This example uses a combobox, but any type of list control that accomodates

Create a Sortable Column Dynamically

There are times when sorting your resultset by the primary key doesn’t accomplish what you need. One way to get around this is to create a sortable column dynamically in

USE API Programming to Determine Whether a File Exists

Put this code in a BAS Module: Public Const INVALID_HANDLE_VALUE = -1Public Const MAX_PATH = 260Public Type FILETIME dwLowDateTime As Long dwHighDateTime As LongEnd TypePublic Type WIN32_FIND_DATA dwFileAttributes As Long

Change the Look and Feel of a Java Application

Use the following code to give your Java app a Windows look and feel: UIManager.setLookAndFeel(“com.sun.java.swing.plaf.windows.WindowsLookAndFeel”); Ensure the class “com.sun.java.swing.plaf.windows.WindowsLookAndFeel” isin your jvm bootstrap classpath. Mostly it can be found in

Object Instance Comparison

Sometimes you need to know if is a specific instance of an object, is the one you’re looking for.objptr() provides a nice VB-ish way to compre object pointers. So, you