directoryLabel = save; dirLabel.setText(directoryLabel);
    public void propertyChange(PropertyChangeEvent e)    {      JFileChooser filechooser = getFileChooser();            String n = e.getPropertyName();      if (n.equals(JFileChooser.MULTI_SELECTION_ENABLED_CHANGED_PROPERTY))        {          int mode = -1;           if (filechooser.isMultiSelectionEnabled())            mode = ListSelectionModel.MULTIPLE_INTERVAL_SELECTION;          else            mode = ListSelectionModel.SINGLE_SELECTION;                    if (listView)            fileList.setSelectionMode(mode);          else            fileTable.setSelectionMode(mode);        }      else if (n.equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY))        {          File file = filechooser.getSelectedFile();                    if (file != null              && filechooser.getDialogType() == JFileChooser.SAVE_DIALOG)            {              if (file.isDirectory() && filechooser.isTraversable(file))                {                  filechooser.setApproveButtonText(openButtonText);                  filechooser.setApproveButtonToolTipText(openButtonToolTipText);                }              else if (file.isFile())                {                  filechooser.setApproveButtonText(saveButtonText);                  filechooser.setApproveButtonToolTipText(saveButtonToolTipText);                }            }                      if (file == null || !file.isFile())            setFileName(null);          else            setFileName(file.getName());          int index = -1;          index = getModel().indexOf(file);          if (index >= 0)            {              if (listView)                {              fileList.setSelectedIndex(index);              fileList.ensureIndexIsVisible(index);              fileList.revalidate();              fileList.repaint();            }              else                {                  fileTable.getSelectionModel().addSelectionInterval(index, index);                  fileTable.scrollRectToVisible(fileTable.getCellRect(index, 0, true));                  fileTable.revalidate();                  fileTable.repaint();                }            }        }            else if (n.equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY))        {          if (listView)            {          fileList.clearSelection();          fileList.revalidate();          fileList.repaint();            }          else            {              fileTable.clearSelection();              fileTable.revalidate();              fileTable.repaint();            }          setDirectorySelected(false);          File currentDirectory = filechooser.getCurrentDirectory();          setDirectory(currentDirectory);          boolean hasParent = (currentDirectory.getParentFile() != null);          getChangeToParentDirectoryAction().setEnabled(hasParent);        }            else if (n.equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY))        {          filterModel.propertyChange(e);        }      else if (n.equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY))        {          filterModel.propertyChange(e);        }      else if (n.equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY)                 || n.equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY))        {          Window owner = SwingUtilities.windowForComponent(filechooser);          if (owner instanceof JDialog)            ((JDialog) owner).setTitle(getDialogTitle(filechooser));          approveButton.setText(getApproveButtonText(filechooser));          approveButton.setToolTipText(                  getApproveButtonToolTipText(filechooser));          approveButton.setMnemonic(getApproveButtonMnemonic(filechooser));        }            else if (n.equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY))        approveButton.setText(getApproveButtonText(filechooser));            else if (n.equals(              JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY))        approveButton.setToolTipText(getApproveButtonToolTipText(filechooser));            else if (n.equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY))        approveButton.setMnemonic(getApproveButtonMnemonic(filechooser));      else if (n.equals(              JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY))        {          if (filechooser.getControlButtonsAreShown())            {              topPanel.add(controls, BorderLayout.EAST);            }          else            topPanel.remove(controls);          topPanel.revalidate();          topPanel.repaint();          topPanel.doLayout();        }            else if (n.equals(              JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY))        {          if (filechooser.isAcceptAllFileFilterUsed())            filechooser.addChoosableFileFilter(                    getAcceptAllFileFilter(filechooser));          else            filechooser.removeChoosableFileFilter(                    getAcceptAllFileFilter(filechooser));        }            else if (n.equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY))        {          JComponent old = (JComponent) e.getOldValue();          if (old != null)            getAccessoryPanel().remove(old);          JComponent newval = (JComponent) e.getNewValue();          if (newval != null)            getAccessoryPanel().add(newval);        }            if (n.equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)          || n.equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)          || n.equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY))        {          // Remove editing component          if (fileTable != null)            fileTable.removeAll();          if (fileList != null)            fileList.removeAll();          startEditing = false;                    // Set text on button back to original.          if (filechooser.getDialogType() == JFileChooser.SAVE_DIALOG)            {              filechooser.setApproveButtonText(saveButtonText);              filechooser.setApproveButtonToolTipText(saveButtonToolTipText);            }                  rescanCurrentDirectory(filechooser);        }            filechooser.revalidate();      filechooser.repaint();    }