October 27, 1998

Swing, Pluggable Look & Feel

With Swing, you can easily change the Look & Feel (L&F) at run time to match one of the L&F implementations in your system. This program contains strings identifying three different L&F implementations contained in Swing 1.0.3 for Win95. Compile and run the program to see PL&F in action. The

Using Swing to Create a Rollover Effect

Using Swing you can easily make the image on a button change when you touch the button with the mouse and change again when you press the button. To run this program, substitute the path and name of three small gif files on your hard drive in place of the

Using Swing to Add Tool Tips

Using Swing, you can easily add tool tips to any of the components in your GUI. Tool tips aren’t normally visible, but they become visible when you point at the component with the mouse. This code was tested using JDK1.1.6 and Swing 1.0.3 under Win95: import java.awt.*;import java.awt.event.*;import com.sun.java.swing.*;public class

Macintosh Platform?

Question: Is Delphi available for a Macintosh platform? Answer: At this time, there is no version of Delphi available for the Macintosh.

Advantages of Declaring a Constant Object as Const

By declaring a variable that doesn’t change throughout program’s execution as const, you make your code safer and more readable. But there’s an additional advantage: efficiency. An optimizing compiler can take advantage of a const object, and store it in a machine register instead of ordinary memory. Such optimization can

Inheritance Relationship of Templates

A common mistake is to assume that a vector is like a vector if Derived is a subclass of Base. However, there is no relationship between classes generated from the same class template. As a result, this relationship doesn’t hold. The reason is that templates are instantiated at compile time.

Swing, Images on Buttons

Swing makes it easy to place an image on just about any component. To see an image on a button, substitute the path and file name of an image on your hard drive in place of the gif file shown in the code below. This code was tested using JDK1.1.6

Before You Profile Your Software…

If you intend to optimize your software’s performance, make sure to profile the release version rather than the debug version. The debug version of the executable contains additional code (about 40% extra compared to the equivalent release executable) for symbol lookup and other debug “scaffolding.” In addition, most compilers have

Inline Assembly

C++ is used in as diverse fields as high-level GUI through the lowest level real-time applications. In time-critical sections of C++ code, you can ensure enhanced responsiveness by combining inline assembly instructions. The asm keyword designates a block of native assembly code: // A flight control app with high level