private void updateTable(){
//        FileTable tablemodel = new FileTable();
//        myfiletable = new JTable(tablemodel);
        files = new ArrayList<File>();
        dirs = new ArrayList<File>();
        
        int rowCount=tablemodel.getRowCount();
        for (int i = rowCount - 1;i >= 0;i--) {
            tablemodel.removeRow(i);
        }
        
        File folder = new File(currentpath);
        File[] filelist = folder.listFiles();
        if (!filelist.equals(null)){
        	for (File currentfile : filelist){
        		if(currentfile.isFile())
        			files.add(currentfile);
        		else if(currentfile.isDirectory())
        			dirs.add(currentfile);
        	}
        	if(!currentpath.equals(rootpath))
        		tablemodel.addRow(new Object[]{"..","","","yes"});
        	for(int i = 0;i<dirs.size();i++){
        		tablemodel.addRow(new Object[]{dirs.get(i).getName(),"",new SimpleDateFormat().format(new Date(dirs.get(i).lastModified())),"yes"});
        	}
        	for(int i = 0;i<files.size();i++){
        		tablemodel.addRow(new Object[]{files.get(i).getName(),files.get(i).length() + " bytes",new SimpleDateFormat().format(new Date(files.get(i).lastModified())),"yes"});
        	}
        	pathlabel.setText("path:" + currentpath);
        }
        else{
        	if(!currentpath.equals(rootpath))
        		tablemodel.addRow(new Object[]{"..","","","yes"});        	
        }
	}