Register a listener object on the button

Listing 9 registers a listener object on the button to cause it to

Listing 9. Register a listener object on the button.
    getDataButton.addActionListener(
      new ActionListener(){
        public void actionPerformed(ActionEvent e){

          redField.setText(explorer.getRValue());

        }//end action performed
      }//end newActionListener
    );//end addActionListener
    //--------------------------------------------------//

  }//end constructor
}//end class Prob12Runner
File: az.htm [Next] [Prev]