//search files and directories
public void getFile1(String directoryName) throws Exception {
File directory = new File(directoryName);
String str = directory.getName();
File[] fList = directory.listFiles();
if (fList != null) {
for (File file : fList) {
{
if (file.isFile())
{
st = (file.toString());
System.out.println(st);
jLable1.setText(st);//jLable1 is not updating.
String fileName = file.getName();
String strvirusCount=Integer.toString(virusCount);
}
else if (file.isDirectory())
{
getFile1(file.getAbsolutePath());
}
globalCount++;
}
}
//while retrieving all files and folder unable to update label when process start to with retrieving path Swing form get unresponsive.