[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


Events Tab

The Events tab displays information about the selected component's events. By default, all events are disabled. After you modify an event, the RAD tools automatically generate source code. This generated code provides a structured framework to handle the event. You supply the code that determines the way the object behaves and interacts with other objects in your user interface.

To modify a particular event, click its blank text field. The Object Inspector displays and highlights a default name for the event. If you want to change this default name, type a new name.


TIP

You can quickly create a new event by double-clicking its blank text field. This double-click accepts the default name for the event.

After you make changes, press Enter/Return to let the RAD tools automatically generate source code. An editor window opens, displays the generated code, and highlights the name you chose for the event. Listing 13.1 shows the generated code for a componentResized event in a Java AWT checkbox component.

Sample generated code:
public
void checkbox1componentResized(java.awt.event.ComponentEvent e)
{
}

You must supply the code that specifies the component's behavior. For example, the generated code in Listing 13.1 does not include any code inside the braces. You must create the code within these braces in order to control the component's behavior in your application. Choose Save from the File menu or press Ctrl/Command-S to immediately save your changes.

If you decide against modifying an event, press the Esc key on your keyboard. The Object Inspector discards your changes.


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 17, 2000