Designing Forms

See Also   Tasks

A form is a graphical representation of a window. Forms can be used to create standard windows, Multiple Document Interface (MDI) windows, dialog boxes, or display surfaces for graphical routines. As with all objects in Java, forms are also classes. To define the user interface for a form, you place controls on its surface. Each form and control contains properties and events that define behavior, appearance, and functionality.

In order for a form and its controls to be displayed properly, you typically add an extensive amount of code to the form's class. To make this task easier, you can use the Forms Designer. The Forms Designer is a graphical tool for defining forms for your applications. You can visually add controls to a form, set the properties for the form and its controls, and create event handlers for the events that you want to respond to.

The Forms Designer contains the following components:

You typically design a form as follows:

With the Forms Designer, you can also: