![]()
We will now return to the JavaApplet.ins and apply a template that modifies the code. This will result in the addition of a new feature to the JavaApplet.class. Specifically, we will add a cross-hair graphic that can be dragged around by the mouse.
VFC's templates are highly customizable code 'wizards' that allow you to use one template to start a program and another one to modify the same program.
Families of structured templates (i.e. a set of templates that use the same coding framework) work together to add new, customized code to a common code framework. Part of this idea shows up in the choices made for default names seen in the last two templates used. The base name JavaApplet in both Java and HTML templates were consistent by design. VFC templates take this idea a bit further. Overall flow structures, specially defined variables, and 'tags' (i.e. specially formatted comments) are used to create a coding framework that 'smart' templates can 'read' and add to intelligently.
15.Shut down the Applet Viewer. Go back to the JavaApplet.ins and insert the Drag CrossHair TemplatInsertingaFlowCodeTemplate>Maine found in the Java templates directory.
16.Be sure that the JavaApplet flowcode file is in AutoExport mode and press the save button,
.
17.In the Java Applet file press the compile button ,
.
18.After the compile is finished, press the run button ,
, to see it in the Applet viewer. Alternatively, you can go back to the HTML flowcode and press run, or just run the HTML web page from the workspace window. Either way you will see a cross hair in the applet that you can drag around with the mouse.

OPTIONAL EXERCISE: The 'Drag CrossHair.ins' template made several modifications to the code in different locations. It is instructive to examine the flowcode before and after this insertion step. You may want to try using the undo/redo,
, buttons and the cursor keys to flip and browse the JavaApplet.ins flow chart between the before and after template insertion.
![]()