Cannot reload jlist
I have made a file folder that shows the files list in the folder. After I select the folder, it will run the LoadFileList method and the list of files will be displayed in the JList called fileList.
privatevoid LoadFileList(String path){
String userDir = path;
File folder =new File(userDir);
Vector data =new Vector();
String[] children = folder.list();
if (children ==null){
// Either dir does not exist or is not a directory
}else{
for (int i=0; i<children.length; i++){
// Get filename of file or directory
String filename = children[i];
data.add(filename);
jLabel1.setText(filename);
}
// updateList(data);
fileList =new JList(data);
fileList.revalidate();
fileList.repaint();
}
}
However, the jlist cannot be updated after the folder is selected...I have tried many different method... but still not work..
please give me some advices to solve this.
Thank you.>

