The JFileChooser class has an addActionListener(...)
method that will accept your ActionListener above. It doesn't have to be shown as a pop-up for it to work.
You never tell us if or how you are adding the ActionListener above to the JFileChooser, but if you are in fact doing this and your code still isn't working, then you'll want to create and post an sscce for us to test and fix.
Edit
Also, I would create the ActionListener to be used with the JFileChooser only and would thus get rid of this line:
else if (e.getSource() instanceof JFileChooser){
If the listener is only added to one object, there's no need to test for the source.