RgnChange example for Visual J++

The following code for the RgnChange event updates a text box using the GetRgnArea method. You can test it by adding a text box for the lesson described in Outlining, Dragging, and Pasting a Region.

private void LEAD1_rgnChange(Object source, Event e)
{
   String strMyText = "Number of pixels in region: ";
   strMyText += LEAD1.GetRgnArea();
   edit1.setText( strMyText );
}