sagt mal wie kann ich meinen FileChoser dazu bringen, dass er multiselection annimmt?
Code:
/**
* listens to the Button open
* @see ActionListener
*/
class OpenListener implements ActionListener
{
public void actionPerformed(ActionEvent ae)
{
int option = fch.showOpenDialog(null);
fch.setMultiSelectionEnabled(true);
//validate if opened file is csv file and if so enable next button
if(option == JFileChooser.APPROVE_OPTION){
File ressourceFile = fch.getSelectedFile();
fch.setCurrentDirectory(fch.getCurrentDirectory());
if(ressourceFile.exists()){
filelist = ressourceFile.getName();
statusbar.setText("You have chosen " + filelist);
if(filelist.compareTo("nothing") != 0)
wizard.setNextButtonEnabled(true);
else {
statusbar.setText("Please choose a ressource:");
wizard.setNextButtonEnabled(false);
}
}else
statusbar.setText("This file doesn't exist.");
}else{
statusbar.setText("Please choose a ressource:");
return;
}
uri = fch.getSelectedFile().toURI();
boolean isRightURI = checkURI(uri);
if(isRightURI)
resourceDl.addElement(uri);
updateUI();
if(resourceList.getModel().getSize() == 0){
getWizard().setNextButtonEnabled(false);
}else{
getWizard().setNextButtonEnabled(true);
}
}
}