Microsoft SDK for Java

Windows Visual Components

The main package in WFC that supports the visible components is com.ms.wfc.ui and the base class for most visual elements in WFC is com.ms.wfc.ui.Control. Most of the WFC controls extend this class, including the Form class, which is the visual container for controls.

This section describes the Microsoft® Windows® visual components of WFC, including the following topics:

com.ms.wfc.ui.Control class

com.ms.wfc.ui.Form class

WFC Controls Overview

Accessing Graphical Services

com.ms.wfc.ui.Control Class

The Control class contains all the essential base properties, methods, and logic for manipulating a Win32 window. These methods can be categorized as follows:

The Control class extends com.ms.wfc.core.Component class, which is the base class for all WFC components.

com.ms.wfc.ui.Form Class

A form is the main visual element of an application or a custom dialog box associated with an application. The com.ms.wfc.ui.Form class serves as the foundation for forms in WFC. The Form class extends com.ms.wfc.ui.Control, so it has all the Control methods plus many of its own for handling its role as a container for controls and as a window. These include methods used to:

This list is not comprehensive but provides a general description of a form.

WFC Controls Overview

All visible WFC controls reside in the com.ms.wfc.ui package. With over 240 classes in this package, it can be difficult to immediately determine which classes you want to use. Fortunately, the classes fall into several major categories, as follows:

The com.ms.wfc.ui classes in the following table directly extend Control. Controls that extend these classes are listed in the description.

Class Description
Animation Encapsulates a Windows animation control, a rectangular control that plays an Audio-Video Interleaved (AVI) animation file.
AxHost Wraps an ActiveX control and exposes the control as a WFC control.
Button Encapsulates a Windows button control.
Checkbox Encapsulates a Windows check box control, which is a labeled box that is checked or unchecked to select or clear an option.
ComboBox Encapsulates the Windows combo box control.
DateTimePicker Encapsulates a Windows date and time picker control, which allows users to specify date and time information.
Edit Encapsulates a Windows edit control, which is a rectangular control that the user can enter text into.
Form Represents the basic top-level window.
GroupBox Encapsulates a group box control, which is a rectangle that contains other controls.
Label Encapsulates the Windows label control, which displays a string of text that the user cannot edit.
ListBox Encapsulates the Windows list box control, which displays a list from which the user can select one or more items. ListItem is used with this class. The CheckedListBox control extends this class.
ListView Encapsulates the Windows list view control, which displays a collection of items, each consisting of an icon (from an image list) and a label.
MDIClient Represents a window that contains MDI child windows.
MonthCalendar Encapsulates a Windows month calendar control, which provides a simple calendar interface from which the user can select a date.
Panel Represents a container you can use to parent other controls visually. The TabPage class extends Panel.
PictureBox Encapsulates a Windows PictureBox control used to contain bitmaps.
ProgressBar Encapsulates the Windows ProgressBar control, which dynamically tracks the progress of an operation by moving a bar.
RadioButton Encapsulates a Windows radio button (or option button) control, which displays an option that can be selected or cleared.
Rebar Encapsulates a rebar control, which contains other controls within moveable, resizable bands. RebarBand is used with this class.
RichEdit Encapsulates a Windows RichEdit control.
ScrollBar Represents the base class for scroll bar controls. HScrollBar and VScrollBar extend ScrollBar.
Splitter Encapsulates the splitter control, which allows the user to resize docked controls at run time.
StatusBar Encapsulates the Windows status bar control. StatusBarPanel is used with this class.
TabBase Defines the base class that contains common functionality for Tab classes controls. TabControl (which uses TabPage) and TabStrip (which uses TabItem) extend this class.
ToolBar Encapsulates the ToolBar custom control. ToolbarButton is used with this class.
TrackBar Encapsulates a Windows trackbar control (also known as a slider control), which contains a slider for selecting a value in a range.
TreeView Encapsulates a Windows tree view control. TreeNode is used with this class.
UpDown Encapsulates the up-down control (sometimes called a spinner control).

Accessing Graphical Services

Applications in the WFC environment perform graphical operations by using the Graphics object, which encapsulates the native drawing capabilities of the Windows operating system. This object provides flexible support for the most commonly used drawing operations, including displaying images and icons and drawing lines, polygons, and text.

The Graphics object performs its work by wrapping a Windows device context, a system data structure that defines system graphical objects, their associated attributes, and the graphic modes affecting output to a device. Because you can retrieve the device context that underlies a Graphics object, you can use the Graphics object seamlessly with native Win32 drawing routines.

All WFC objects that extend the Control object support creating a Graphics object through the createGraphics method. In addition, all objects that extend the Image object, such as Bitmap, Icon, and Metafile, support the creation and retrieval of their associated Graphics object through the getGraphics method.

For more information on how to use this object, see Graphical Services.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.