public void propertyChange(PropertyChangeEvent e) {
        if(e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) {
            File newFile =(File)e.getNewValue();
            if (newFile != null){
                if ((newFile.isFile()) && (FileDialogs.isImage(newFile))) {
                    String newPath = newFile.getAbsolutePath();
                    currentImageR = new ImageReference(newPath);
                    isDir=false;
                }
                else if(newFile.isDirectory()) {
                    currentImageR=null;
                    isDir=true;
                }
                thumb.setToolTipText(newFile.getName());
            }
            else {
                currentImageR=null;
                isDir=true;
                thumb.setToolTipText("");
            }
        }
        RepaintManager.repaint(RepaintType.Preview);
    }