Package javax.swing

Examples of javax.swing.JFileChooser.showOpenDialog()


      };
      while (true) {
        chooser.setDialogType(JFileChooser.OPEN_DIALOG);
        chooser.setFileFilter(filter);
        chooser.setDialogTitle("Select source image file");
        int returnVal = chooser.showOpenDialog(null);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
          String srcFilename = chooser.getSelectedFile().getAbsolutePath();
          chooser.setDialogTitle("Select destination image file");
          chooser.setDialogType(JFileChooser.SAVE_DIALOG);
          returnVal = chooser.showSaveDialog(null);
View Full Code Here


    String cdata = null;

    JFileChooser fc = new JFileChooser(".");
    fc.setSelectedFile(new File(EditorXML.itemsFile));
    fc.setDialogTitle("Choose items XML file");
    int returnVal = fc.showOpenDialog(this);
    if (returnVal == 0) {
      java.io.File file = fc.getSelectedFile();
      cdata = file.getAbsolutePath();
    } else {
      return;
View Full Code Here

    String cdata = null;

    JFileChooser fc = new JFileChooser(".");
    fc.setSelectedFile(new File(EditorXML.creaturesFile));
    fc.setDialogTitle("Choose creatures XML file");
    int returnVal = fc.showOpenDialog(this);
    if (returnVal == 0) {
      java.io.File file = fc.getSelectedFile();
      cdata = file.getAbsolutePath();
    } else {
      return;
View Full Code Here

      {
        JFileChooser fc = new JFileChooser();
        fc.setCurrentDirectory(new File("."));
        fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        fc.setAcceptAllFileFilterUsed(false);
        int retval = fc.showOpenDialog(wsform);

        if (retval == JFileChooser.APPROVE_OPTION)
        {
          // ... The user selected a file, get it, use it.
          File file = fc.getSelectedFile();
View Full Code Here

//ENV_LABEL_PREFIX       
        browseButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JFileChooser fileChooser = SharedJFileChooser.getInstance(SharedJFileChooserType.XML_FILE, JFileChooser.FILES_AND_DIRECTORIES, loadDefaultEnv.getText());
             
                if (fileChooser.showOpenDialog(browseButton.getParent()) == JFileChooser.APPROVE_OPTION){
                    if (fileChooser.getSelectedFile() != null){
                         loadDefaultEnv.setText(fileChooser.getSelectedFile().getAbsolutePath());
                    }
                }             
            }
View Full Code Here

       
        browseDestDirButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JFileChooser fileChooser = SharedJFileChooser.getInstance(SharedJFileChooserType.NO_FILTER, JFileChooser.DIRECTORIES_ONLY, defaultDirectory.getText());

                if (fileChooser.showOpenDialog(browseButton.getParent()) == JFileChooser.APPROVE_OPTION){
                    if (fileChooser.getSelectedFile() != null){
                         defaultDirectory.setText(fileChooser.getSelectedFile().getAbsolutePath());
                    }
                }             
            }
View Full Code Here

        final String html = this.mHTMLReport;

        final String path = NbPreferences.forModule(SimpleHTMLReport.class).get(LAST_PATH, null);
        JFileChooser fileChooser = new JFileChooser(path);
        fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        int result = fileChooser.showOpenDialog(WindowManager.getDefault().getMainWindow());
        if (result == JFileChooser.APPROVE_OPTION) {
            final File destinationFolder = fileChooser.getSelectedFile();
            NbPreferences.forModule(SimpleHTMLReport.class).put(LAST_PATH, destinationFolder.getAbsolutePath());
            Thread saveReportThread = new Thread(new Runnable() {
View Full Code Here

        chooser.setAcceptAllFileFilterUsed(false);
        DialogFileFilter dialogFileFilter = new DialogFileFilter(NbBundle.getMessage(ImportCSVUIVisualPanel1.class, "ImportCSVUIVisualPanel1.filechooser.csvDescription"));
        dialogFileFilter.addExtension("csv");
        chooser.addChoosableFileFilter(dialogFileFilter);
        chooser.setSelectedFile(selectedFile);
        int returnFile = chooser.showOpenDialog(null);
        if (returnFile != JFileChooser.APPROVE_OPTION) {
            return;
        }

        selectedFile = chooser.getSelectedFile();
View Full Code Here

  @Override
  public void actionPerformed(ActionEvent e) {
    JFileChooser fileChooser = SharedJFileChooser.getInstance(SharedJFileChooserType.XML_FILE,
        JFileChooser.FILES_ONLY);
    if (fileChooser.showOpenDialog(parent) == JFileChooser.APPROVE_OPTION) {
      File selectedFile = fileChooser.getSelectedFile();
      environment.loadJobs(selectedFile);
    }

  }
View Full Code Here

   
    openButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JFileChooser fileChooser = SharedJFileChooser.getInstance(SharedJFileChooserType.PDF_FILE, JFileChooser.FILES_ONLY);
                fileChooser.setMultiSelectionEnabled(true);
                if (fileChooser.showOpenDialog(JVisualMultiSelectionPanel.this) == JFileChooser.APPROVE_OPTION){
                  File[] chosenFiles = fileChooser.getSelectedFiles();
                    tabsAdder.addTabs(chosenFiles);
                }              
               
            }
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.