private void jButtonFromLocalFileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonFromLocalFileActionPerformed
javax.swing.JFileChooser fileChooser = new javax.swing.JFileChooser();
fileChooser.setMultiSelectionEnabled(true);
fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
FileFilter filter = new FileFilter() {
@Override
public boolean accept(File f) {
String extension = "";
EmailFilesFilter[] filters =
Lookup.getDefault().lookupAll(EmailFilesFilter.class).toArray(new EmailFilesFilter[0]);
for (EmailFilesFilter filter : filters) {
if (filter.getDisplayName().equals(jComboBoxFileFilters.getSelectedItem().toString())) {
extension = filter.getSupportedFileExtension();
}
}
if (f.isDirectory()) {
return true;
} else if (f.getAbsolutePath().matches(".*" + extension)) {