Good people I got to get where I wanted, or better already started ...
The code is as shown below, what I'm doing is capturing all sorts of selection and what I did with the open button was to change the text in it no more, but when I get the address of the selected directories I call the method again.
The code:
import java.io.File;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
/**
*
* @author Cizo
*/
public class MyFileChooser extends JFrame {
public void seleciona() {
File diretorio = new File("C:\");
JFileChooser fileChooser = new JFileChooser(diretorio);
fileChooser.resetChoosableFileFilters();
UIManager.put("FileChooser.openDialogTitleText", "Seleçao de aquivos");
UIManager.put("FileChooser.lookInLabelText", "Local");
UIManager.put("FileChooser.openButtonText", "Inserir");
UIManager.put("FileChooser.cancelButtonText", "Sair");
UIManager.put("FileChooser.fileNameLabelText", "Nome do Arquivo");
UIManager.put("FileChooser.filesOfTypeLabelText", "Tipo de Arquivo");
UIManager.put("FileChooser.openButtonToolTipText", "Abrir Selecionado");
UIManager.put("FileChooser.cancelButtonToolTipText", "Sair");
UIManager.put("FileChooser.fileNameHeaderText", "Nome do Arquivo");
UIManager.put("FileChooser.upFolderToolTipText", "Subir Nivel Acima");
UIManager.put("FileChooser.homeFolderToolTipText", "Desktop");
UIManager.put("FileChooser.newFolderToolTipText", "Nova Pasta");
UIManager.put("FileChooser.listViewButtonToolTipText", "Lista");
UIManager.put("FileChooser.newFolderButtonText", "Criar Nova Pasta");
UIManager.put("FileChooser.renameFileButtonText", "Renomear");
UIManager.put("FileChooser.deleteFileButtonText", "Apagar");
UIManager.put("FileChooser.filterLabelText", "Tipo de Arquivos");
UIManager.put("FileChooser.detailsViewButtonToolTipText", "Detalhes");
UIManager.put("FileChooser.fileSizeHeaderText", "Tamanho");
UIManager.put("FileChooser.fileDateHeaderText", "Data de Modificação");
SwingUtilities.updateComponentTreeUI(fileChooser);
fileChooser.setMultiSelectionEnabled(true);
fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
File[] dir = null;
switch (fileChooser.showOpenDialog(this)) {
case JFileChooser.APPROVE_OPTION:
dir = fileChooser.getSelectedFiles();
for (File dir1 : dir) {
System.out.println("AQUI > " + dir1);
}
seleciona();
break;
case JFileChooser.CANCEL_OPTION:
JOptionPane.showMessageDialog(null, "Final");
break;
}
}
}
JFileChooser looks like this: