Package javax.swing

Examples of javax.swing.JFileChooser.showOpenDialog()


            public void actionPerformed(ActionEvent e) {
                JFileChooser chooser = new JFileChooser(source.getText());
                chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
                chooser.setDialogTitle("Select source installation directory (0.16.1)");
                if (chooser.showOpenDialog(GUIUpgrader.this) == JFileChooser.APPROVE_OPTION) {
                    source.setText(chooser.getSelectedFile().getAbsolutePath());
                }
            }
        });
        gbc.weightx = 0.0;
View Full Code Here


        browseTarget.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JFileChooser chooser = new JFileChooser(target.getText());
                chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
                chooser.setDialogTitle("Select target installation directory (0.2.5+)");
                if (chooser.showOpenDialog(GUIUpgrader.this) == JFileChooser.APPROVE_OPTION) {
                    target.setText(chooser.getSelectedFile().getAbsolutePath());
                }
            }
        });
        gbc.weightx = 0.0;
View Full Code Here

            }
        };

        final JFileChooser chooser = new JFileChooser();
        chooser.setFileFilter(myFilter);
        final int returnVal = chooser.showOpenDialog(this);
        if(returnVal == JFileChooser.APPROVE_OPTION) {
            return chooser.getSelectedFile();
        }
        return null;
    }
View Full Code Here

        fc.setDialogTitle(language.getString("MessageFrame.fileChooser.title"));
        fc.setFileHidingEnabled(false);
        fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
        fc.setMultiSelectionEnabled(true);

        final int returnVal = fc.showOpenDialog(MessageFrame.this);
        if( returnVal == JFileChooser.APPROVE_OPTION ) {
            final File[] selectedFiles = fc.getSelectedFiles();
            for( final File element : selectedFiles ) {
                // for convinience remember last used directory
                frostSettings.setValue(SettingsClass.DIR_LAST_USED, element.getPath());
View Full Code Here

        )
    );
    chooser.setDialogTitle(language.getString("AddNewDownloadsDialog.changeDirDialog.title"));
    chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    chooser.setAcceptAllFileFilterUsed(false);
    if (chooser.showOpenDialog(this) != JFileChooser.APPROVE_OPTION) {
      return;
    }
   
    // Set dir for selected items
    setDownloadDir(chooser.getSelectedFile().toString());
View Full Code Here

    fc.setDialogTitle(language.getString("Options.downloads.filechooser.title"));
    fc.setFileHidingEnabled(true);
    fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    fc.setMultiSelectionEnabled(false);

    final int returnVal = fc.showOpenDialog(this);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
      final File file = fc.getSelectedFile();
      Core.frostSettings.setValue(SettingsClass.DIR_LAST_USED, file.getParent());
      downloadDirTextField.setText(file.getPath());
      updateDownloadDirTextFieldBackground();
View Full Code Here

    fc.setFileHidingEnabled(true);
    fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
    fc.setMultiSelectionEnabled(true);
    fc.setPreferredSize(new Dimension(600, 400));

    if (fc.showOpenDialog(this) != JFileChooser.APPROVE_OPTION) {
      return frostUploadItemList;
    }
    final File[] selectedFiles = fc.getSelectedFiles();
    if( selectedFiles == null ) {
      return frostUploadItemList;
View Full Code Here

            // (ulrivo): set default directory if set from command line
            if (defDirectory != null) {
                f.setCurrentDirectory(new File(defDirectory));
            }

            int option = f.showOpenDialog((Component) fMain);

            if (option == JFileChooser.APPROVE_OPTION) {
                File file = f.getSelectedFile();

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

   
    int option;
    if (save) {
      option = fileChooser.showSaveDialog((JComponent)parentView);
    } else {
      option = fileChooser.showOpenDialog((JComponent)parentView);
    }   
    if (option == JFileChooser.APPROVE_OPTION) {
      // Retrieve current directory for future calls
      this.currentDirectory = fileChooser.getCurrentDirectory();
      // Return selected file
View Full Code Here

        }

        final JFileChooser fc = new JFileChooser(lastDirectory);

        fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        final int returnVal = fc.showOpenDialog(jScrollPane);

        if (returnVal == JFileChooser.APPROVE_OPTION) {
          final File file = fc.getSelectedFile();
          Preferences.userNodeForPackage(AnimationRunner.class).put("lastpath", file.getAbsolutePath());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.