if(selectedNames.length != 0) { for(int i = 0; i < directory.size(); i++) { VFS.DirectoryEntry file = (VFS.DirectoryEntry)directory .elementAt(i); String name = file.name; for(int j = 0; j < selectedNames.length; j++) { if(selectedNames[j].equals(name)) { list.addSelectionInterval(i,i); break; } } } }
timer.stop(); typeSelectBuffer.setLength(0);
	public void directoryLoaded(Vector directory)	{		// preserve selected files so user won't be annoyed by		// automatic updates		VFS.DirectoryEntry[] selected = getSelectedFiles();		String[] selectedNames = new String[selected.length];		for(int i = 0; i < selected.length; i++)		{			selectedNames[i] = selected[i].name;		}		if(directory == null)			list.setListData(new Object[0]);		else			list.setListData(directory);		// restore selection		if(selectedNames.length != 0)		{			for(int i = 0; i < directory.size(); i++)			{				VFS.DirectoryEntry file = (VFS.DirectoryEntry)directory					.elementAt(i);				String name = file.name;				for(int j = 0; j < selectedNames.length; j++)				{					if(selectedNames[j].equals(name))					{						list.addSelectionInterval(i,i);						break;					}				}			}		}	}