Java JFileChooser cleanFileSelector(JFileChooser filterUpdates)

Here you can find the source of cleanFileSelector(JFileChooser filterUpdates)

Description

set selected file to " ", and current directory to last selected current directory

License

Open Source License

Parameter

Parameter Description
filterUpdates a parameter

Declaration

public static void cleanFileSelector(JFileChooser filterUpdates) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.File;

import javax.swing.JFileChooser;

public class Main {
    /**/*from   w ww  .  j  a  v  a2s . c o  m*/
     * set selected file to " ", and current directory to last selected current directory
     * @param filterUpdates
     */
    public static void cleanFileSelector(JFileChooser filterUpdates) {
        File f = filterUpdates.getCurrentDirectory();
        filterUpdates.setSelectedFile(new File(" "));
        filterUpdates.setCurrentDirectory(f);
    }
}

Related

  1. chooseOpenFile(String dir, String fileName, String fileNameExtension, Component parent)
  2. chooseSaveFile(Component parent, File defaultFile, FileFilter filter)
  3. chooseSaveFile(String dir, String initialFile, String fileNameExtension, Component parent)
  4. choseFile(File selectedFile, String startDir, final String description, final String extension, Component parent, boolean addExtension, boolean forLoad)
  5. cleanFileSelector(JFileChooser filterUpdates)
  6. configureFileChooser(JFileChooser fchooser, boolean directoryOnly, File selectedFile)
  7. correctSelectedFileExtension(JFileChooser chooser)
  8. createChooser(String lastPath, final boolean checkOverrideFile)
  9. createFileChooser(File presetFile, final String... postfixes)