I need the listener to fire whenever the user clicks onto a different component, not just when the enter key is pressed. I also need to identify the source because I have hundreds of JTextField's and the only way I have to identify them is through an array index.

I can get the source from an ActionListener, but an ActionListener only fires when the user presses the enter key.

I can attach a DocumentListener to the associated Document of the JTextField, but there doesn't seem to be a way to get a reference to the JTextField itself.

How can I do this?