title: How do I add the same listener to multiple components in the NetBeans GUI Builder
body: <p>I am using the NetBeans GUI Builder to create a small application. To begin, let me just say that I can code everything by hand and solve this problem right away. However, I want to learn how to use the GUI Builder. This is my warning that all suggestions to not use it will get a down vote.</p>
  
  <p>With that said, my current situation is that I have several <code>JFormattedTextField</code>s where I want to display an error message if the user enters data with an invalid format. The logic is the same in every case. The only difference will be to display a different error message depending on the exact formatting expected (i.e. a four digit year, a positive integer, etc.). I would like to simply write one listener that can be reused for every text field. I wrote the following method for the first text box:</p>
  
  <pre><code>private void formattedTextFieldFocustLost(java.awt.event.FocusEvent evt) {
      JFormattedTextField source = (JFormattedTextField)evt.getComponent();
  
      if (!source.isEditValid()) {
          // TODO: Need a better error message.
          JOptionPane.showMessageDialog(this, "Invalid input.", "Input Error", JOptionPane.ERROR_MESSAGE);
          source.requestFocusInWindow();
      }
  }
  </code></pre>
  
  <p>The method signature is generated by NetBeans and is called from a generated of an anonymous inner class which extends <code>FocusAdapter</code>. Now when I go to the Design view in NetBeans and click on the combo box for the <code>focusLost</code> event of another component, this method name doesn't show up.</p>
  
  <p>I also tried to create a named inner class which extends <code>FocusAdapter</code>. This doesn't show up in the event handler comboboxes, either.</p>
  
  <p>What do I do to create a single method for all of my text fields? </p>