EnableMethodErrors example for Visual J++

This example disables method errors temporarily so that it can give the user guidance about a particular error (an out-of-range shear angle in this case).

short sShearAngle = 9000;  //This would be the user's input * 100
LEAD1.setEnableMethodErrors( false );
short sRet = LEAD1.Shear( sShearAngle, true, new Color( 0, 0, 255 ) );
if( sRet == 20013 )
   MessageBox.show( "The angle cannot be more than 45 degrees", "Error", MessageBox.OK );
else
   LEAD1.ForceRepaint();
LEAD1.setEnableMethodErrors( true );