public void mouseClickedOpen(MouseEvent e) {
      int index = list.locationToIndex(e.getPoint());
      ListModel lm = list.getModel();
      JPanel dir = (JPanel) lm.getElementAt(index);

      list.ensureIndexIsVisible(index);
      File f = new File(dir.getName());
      if (f.isDirectory()) {
        //listDirectory(dir.getName(), list, left);
        if (f.getPath().toLowerCase().startsWith("/var/tmp/usb")) {
          listDirectory(dir.getName(), list, left);
        } else {
          System.out.println("we do not permit");
        }
    
      } else if (f.isFile() && desktop != null) {
        try {
          String filename = f.getName().toLowerCase();
          if (filename.endsWith(".pdf") || filename.endsWith(".jpeg") || filename.endsWith(".jpg")  || filename.endsWith(".ppt")) {
            System.out.println("valid file " + filename.compareTo(".pdf"));
            desktop.open(f);

          } else {
            System.out.println("invalid file");
          }
    
          //desktop.open(f);
          
        } catch (IOException ex) {
          ex.printStackTrace();
        }
      }
      
      
    }
  }

  private void showThumbmail(String name, JList list, MouseEvent e) {
    File file = new File(name);
    try {
      String type = " (*" + file.getName().substring(file.getName().lastIndexOf(".")) + ")";
      type = type.toLowerCase();
      if (type.contains(".pdf")) {
        ThumbmailDialog td = new ThumbmailDialog(getFrame(), true);
        td.doPdfThumbmail(file);
        td.setVisible(true);
      } else if (type.contains(".jpg") || type.contains(".jpeg") || type.contains(".gif") || type.contains(".png")) {
        ThumbmailDialog td = new ThumbmailDialog(getFrame(), true);
        td.doImageThumbmail(file);
        td.setVisible(true);
      } else {
        propertiesDialog();
      }
    } catch (Exception ex) {
      propertiesDialog();
    }