How can I use JFileChooser to open two text files and after I selected these files, I want to compare them, show on the screen etc. Is this possible?
In my case I solved it declaring frame as an initialized local variable set to null:
JFileChooser chooser = new JFileChooser(); chooser.setMultiSelectionEnabled(true); Component frame = null; chooser.showOpenDialog(frame); File[] files = chooser.getSelectedFiles();