Home Segments Top Top Previous Next

926: Mainline

The definition in Segment 925 includes the definition of a listener that connects text fields and buttons to setters inside the form, maintaining the form's instance variables.

For example, if you type a new value into the first text field, and press the Enter key, you initiate the following sequence of calls:

The form view           The action event listener       Text field 1 
                                                                 
                                                        Enter pressed 
                                                          | 
                          *-------------------------------* 
                          | 
                          v 
                        actionPerformed 
                          | 
                          *---------------------------> getText 
                          | 
setValue1 <---------------* 

Alternatively, if you press the first plus button, you initiate the following sequence of calls:

The form view           The action event listener       Plus Button 1 
                                                                 
                                                        Mouse clicked 
                                                          | 
                          *-------------------------------* 
                          | 
                          v 
                        actionPerformed 
                          | 
                          | 
setValue1 <---------------*