1 | The test applet instantiates two text fields that share a single handler: handler = new TextFieldHandler( this ); username = new TextField( 20 ); username.addActionListener( handler ); password = new TextField( 20 ); password.addActionListener( handler ); |
2 | Alternatively, each text field could have its own handler |