// return (pathname.endsWith(".java"));
// }
// };
// chooser.setFileFilter(filter);
if (chooser.showDialog(this, "Open File") == JFileChooser.APPROVE_OPTION) {
String msgs[] = { "The selected file was:",
chooser.getSelectedFile().getAbsolutePath()};
JOptionPane.showMessageDialog(this, msgs,
"Results of JFileChooser", JOptionPane.PLAIN_MESSAGE);