TreePath currentPath = tree.getSelectionPath();
			public void mouseClicked(MouseEvent e) {				Point p = new Point(e.getX(), e.getY());				int row = table.rowAtPoint(p);				int column = table.columnAtPoint(p);				File file = (File)tableModel.getValueAt(row, column);				if(file == null) {					row = column = 0;					if(!currentFolder.equals(table.getValueAt(0, 0))) {						if(tableModel.getColumnCount() > 1) column = 1;						else row = 1;					}				}				switch(e.getButton()) {					case MouseEvent.BUTTON1 :					if(e.getClickCount() == 2) {						if(file == null || file.equals(currentFolder)) break;						if(file.isDirectory()) {							boolean down = currentFolder.equals(file.getParentFile());							setFolder(file);							TreePath currentPath = tree.getSelectionPath();							if(currentPath != null) {								if(down) currentPath = currentPath.pathByAddingChild(currentFolder);								else currentPath = currentPath.getParentPath();								tree.setSelectionPath(currentPath);								tree.expandPath(currentPath);								tree.scrollPathToVisible(currentPath);							}						}					}					break;										case MouseEvent.BUTTON2 :					break;										case MouseEvent.BUTTON3 :					if(file == null || file.equals(currentFolder) || file.equals(currentFolder.getParentFile())) {						if(table.getSelectedRow() != row || table.getSelectedColumn() != column) {							table.setRowSelectionInterval(row, row);							table.setColumnSelectionInterval(column, column);						}						clickInFile.show(e.getComponent(), e.getX(), e.getY());						break;					}					int[] rows = table.getSelectedRows();					int[] columns = table.getSelectedColumns();					boolean selectItem = false;					if(rows.length == 1 && columns.length == 1) selectItem = true;					else {						boolean inRows = false;						for(int i = 0; i < rows.length && !inRows; i ++){							if(rows[i] == row) inRows = true;						}						if(!inRows) selectItem = true;						else {							boolean inColumns = false;							for(int i = 0; i < columns.length && !inColumns; i ++) {								if(columns[i] == column) inColumns = true;							}							selectItem = !inColumns;						}					}					if(selectItem && (table.getSelectedRow() != row || table.getSelectedColumn() != column)) {						table.setRowSelectionInterval(row, row);						table.setColumnSelectionInterval(column, column);					}					clickOutFile.show(e.getComponent(), e.getX(), e.getY());					break;				}			}