To illustrate the scripting API, we will write a sample program that allows users to specify event handlers in a scripting language of their choice.
Have a look at the program in Listing 10.1 that adds scripting to an arbitrary frame class. By default it reads the
ButtonFrame class in Listing 10.2, which is similar to the event handling demo in Volume I, with two differences:
• Each component has its
name property set.
• There are no event handlers.
The event handlers are defined in a property file. Each property definition has the form
js.properties, like this: