Example usage for javax.swing JFileChooser setDialogTitle

List of usage examples for javax.swing JFileChooser setDialogTitle

Introduction

In this page you can find the example usage for javax.swing JFileChooser setDialogTitle.

Prototype

@BeanProperty(preferred = true, description = "The title of the JFileChooser dialog window.")
public void setDialogTitle(String dialogTitle) 

Source Link

Document

Sets the string that goes in the JFileChooser window's title bar.

Usage

From source file:wqm.util.ProcessDataGUI.java

public static void main(String[] args) throws IOException, ParseException {
    JFileChooser fc = new JFileChooser();
    fc.setDialogTitle("Select data file.");
    fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
    fc.setMultiSelectionEnabled(true);//from  ww w . j  av a 2 s .c om
    int returnVal = fc.showOpenDialog(null);

    if (returnVal == JFileChooser.APPROVE_OPTION) {
        File[] files = fc.getSelectedFiles();
        fc.setDialogTitle("Select output location.");
        fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        fc.setMultiSelectionEnabled(false);
        returnVal = fc.showOpenDialog(null);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            File outputDirectory = fc.getSelectedFile();
            for (File inputFile : files) {
                ProcessData
                        .main(new String[] { inputFile.getAbsolutePath(), outputDirectory.getAbsolutePath() });
            }
        }
    }
}