I currently have a JFileChooser
in my view class, which I want to trigger certain events stored in my controller class. I add ActionListeners
to JButtons
like the following:
view.setUploadButtonListener(new UploadButtonListener());
where view
is my view class and UploadButtonListener
is an internal class of my controller class. The same way doesn't seem to work for JFileChooser
(at least I can't figure it out).
How can I add an ActionListener
to my JFileChooser
that fires when the user clicks OK. And can I pass the selected file path as argument in the listener as well?