Event handler

From JAXXWiki

An event handler is an attribute on a class tag which begins with on followed by a capital letter, such as onMouseMoved. The value of the attribute is a snippet of Java code to run when the event fires.

By default, JAXX supports all events which can be discovered through introspection, which means that all event broadcasters that follow standard Java naming conventions are supported. Event attributes are named according to the names of the methods in the event listener interface. You can see a list of supported events for all of the Swing tags by visiting the tag's page, for instance Events supported by JFrame.

Within the event handler code, you may refer to the event object using the name event. For example, the code:

<JButton text='Click me!' onActionPerformed='System.out.println("Received click: "   event);'/>

is roughly equivalent to the following Java code:

JButton button = new JButton("Click me!");
button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent event) {
        System.out.println("Received click: "   event);
    }
});