Package javax.swing

Examples of javax.swing.JFileChooser


   *
   * @return the initialized file chooser.
   */
  protected JFileChooser createFileChooser()
  {
    final JFileChooser fc = new JFileChooser();
    fc.addChoosableFileFilter(new FilesystemFilter(getFileExtension(), getFileDescription()));
    fc.setMultiSelectionEnabled(false);
    fc.setCurrentDirectory(getCurrentDirectory());
    return fc;
  }
View Full Code Here


  {
    final File file = new File(getFilename());

    if (fileChooserZip == null)
    {
      fileChooserZip = new JFileChooser();
      fileChooserZip.addChoosableFileFilter
          (new FilesystemFilter(
              new String[]{HtmlZipExportDialog.ZIP_FILE_EXTENSION, HtmlZipExportDialog.JAR_FILE_EXTENSION},
              getResources().getString("htmlexportdialog.zip-archives"), true)); //$NON-NLS-1$
      fileChooserZip.setMultiSelectionEnabled(false);
View Full Code Here

     */
    protected File chooseFile(int type) {
        Frame frame = getFrame();
        File f = null;
        if (fileChooser == null)
            fileChooser = new JFileChooser();

        fileChooser.setCurrentDirectory(E00File);
        if (type == 0)
            fileChooser.setDialogType(JFileChooser.OPEN_DIALOG);
        else
View Full Code Here

        if( initialFile == null ) {
            initialFile = new File( System.getProperty("user.dir") );
        }

        JFileChooser chooser = new JFileChooser(initialFile);
        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        chooser.setMultiSelectionEnabled(false);

        File file = null;
        if (chooser.showOpenDialog(mainPanel) == JFileChooser.APPROVE_OPTION) {
            file = chooser.getSelectedFile();
        }

        return file;
    }
View Full Code Here

            if (gradlePluginLord.getCurrentDirectory() != null) {
               startingDirectory = gradlePluginLord.getCurrentDirectory();
            }
        }

        JFileChooser chooser = new JFileChooser(startingDirectory);
        chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        chooser.setMultiSelectionEnabled(false);

        File file = null;
        if (chooser.showOpenDialog(mainPanel) == JFileChooser.APPROVE_OPTION) {
           file = chooser.getSelectedFile();
        }

       if (file != null) {
          setCustomGradleExecutor(file);
       }
View Full Code Here

  /**
   * Display a file open dialog
   * @param extension The file extension to look for
   */
  public static File showOpenFileDialog(Widget parent, String extension) {
    JFileChooser chooser = new JFileChooser();
    chooser.setFileFilter(new ExtensionFilter(extension, true));
    if (chooser.showOpenDialog(parent.getRealWidget()) == JFileChooser.APPROVE_OPTION) {
      return chooser.getSelectedFile();
    } else {
      return null;
    }
  }
View Full Code Here

  /**
   * Display a file save dialog
   * @param extension The file extension of the destination file
   */
  public static File showSaveFileDialog(Widget parent, String extension) {
    JFileChooser chooser = new JFileChooser();
    chooser.setFileFilter(new ExtensionFilter(extension, true));
    if (chooser.showSaveDialog(parent.getRealWidget()) == JFileChooser.APPROVE_OPTION) {
      String path = chooser.getSelectedFile().getPath();
      if (!path.endsWith("." + extension))
        path = path + "." + extension;
      return new File(path);
    } else {
      return null;
View Full Code Here

  {
    final File file = new File(getFilename());

    if (fileChooserHtml == null)
    {
      fileChooserHtml = new JFileChooser();
      fileChooserHtml.addChoosableFileFilter
          (new FilesystemFilter(
              new String[]{HtmlDirExportDialog.HTML_FILE_EXTENSION, HtmlDirExportDialog.HTM_FILE_EXTENSION},
              getResources().getString("htmlexportdialog.html-documents"), true)); //$NON-NLS-1$
      fileChooserHtml.setMultiSelectionEnabled(false);
View Full Code Here

   */
  protected void performSelectFile()
  {
    if (fileChooser == null)
    {
      fileChooser = new JFileChooser();
      final FilesystemFilter filter = new FilesystemFilter(RTFExportDialog.RTF_FILE_EXTENSION,
          getResources().getString("rtf-exportdialog.rtf-file-description")); //$NON-NLS-1$
      fileChooser.addChoosableFileFilter(filter);
      fileChooser.setMultiSelectionEnabled(false);
    }
View Full Code Here

   */
  protected void performSelectFile()
  {
    if (fileChooser == null)
    {
      fileChooser = new JFileChooser();
      final FilesystemFilter filter = new FilesystemFilter(ExcelExportDialog.XLS_FILE_EXTENSION,
          getResources().getString("excelexportdialog.excel-file-description")); //$NON-NLS-1$
      fileChooser.addChoosableFileFilter(filter);
      fileChooser.setMultiSelectionEnabled(false);
    }
View Full Code Here

TOP

Related Classes of javax.swing.JFileChooser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.