Java JFileChooser getFileChooser()

Here you can find the source of getFileChooser()

Description

get File Chooser

License

Open Source License

Declaration

public static JFileChooser getFileChooser() 

Method Source Code

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

import java.awt.Window;

import javax.swing.JDialog;
import javax.swing.JFileChooser;

public class Main {
    public static JFileChooser getFileChooser() {
        for (Window w : Window.getWindows())
            if (w instanceof JDialog && w.isShowing())
                if (((JDialog) w).getContentPane().getComponent(0) instanceof JFileChooser)
                    return (JFileChooser) ((JDialog) w).getContentPane().getComponent(0);
        throw new IllegalStateException("no file chooser found!");
    }/*from ww  w. j  ava2 s. co  m*/
}

Related

  1. getFile(FileFilter filter)
  2. getFile(String initialPath, final String extension, String TitleText)
  3. getFile(String message, boolean isLoadNotSave, File defaultFileOrDir, boolean allowMultipleSelection, String description, final String... extensions)
  4. getFile(String title, File initialDir)
  5. getFileChooser()
  6. getFileChooser()
  7. getFileChooser()
  8. getFileChooser()
  9. getFileChooser()