To Call Java from Labels
1. Select a shape on a sheet.
2. Click Diagramming > Add Label.
3. Click Add Label. The Create Label dialog box opens.
4. Specify the user-defined method to invoke in the Format box.
5. Probe to place the label.
* 
The method to call must be declared as public static String, taking the first parameter as a shape or a sheet and zero or more parameters of type String. Ensure that the number of String parameters in this syntax is the same as the number of parameters in the method declaration. Otherwise, Java does not find the required method.