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 ); |
Alternatively, each text field could have its own handler |