Register a listener on the text field

Listing 5 shows the beginning of code that

Listing 5. Beginning of anonymous listener class.
    inputFileNameField.addActionListener(
      new ActionListener(){
        public void actionPerformed(ActionEvent e){
          fileName = inputFileNameField.getText();

          pix = new Picture(fileName);
          pix.addMessage("Dick Baldwin",10,20);

          explorer = new PictureExplorer(pix);
 
File: aq.htm [Next] [Prev]