Displaying Forms

Visual Basic | Delphi | C++ Builder | Java

Visual Basic 6.0

The general procedure is

To stop a form from loading, raise an error in its Initialize event.

Delphi 5.0

When a form is shown as modal, simply setting the ModalResult property closes the form and returns the associated value. Some related commands for non-modal forms Normally, forms are added to your application via the *.dpr (Delphi project) file In order to use the form, you must include its unit in the appropriate uses clause.

C++ Builder


In Windows, all modal forms (dialog boxes) can be closed by simply pressing the ESC key. The Java Dialog class does not implement this behavior. Instead, each component in the dialog box must check for keyboard input and determine what to do. Instead, you can use Java World's EscapeDialog (a decendent of Dialog) which correctly interprets the ESC key. Another approach is to subclass the swing dialog (JDialog). In Java 2* In Record Time (1998), Constructing Java Dialog Boxes provides explicit instructions on how to create a dialog box. The example eventually builds a pop-up calculator and shows one way to transfer data between your application and the dialog. (Does not use swing.) (Link broken 4-16-02)

O'Reilly's Java in a Nutshell (1996) provides several examples including

Author: Robert Clemenzi - clemenzi@cpcug.org
URL: http:// cpcug.org / user / clemenzi / technical / Languages / FormDisplay.htm