Package javax.swing

Examples of javax.swing.JFileChooser.showDialog()


        StringUtil.format(Strings.get("fileLibraryMissingError"),
          file.getName()));
      JFileChooser chooser = createChooser();
      chooser.setFileFilter(filter);
      chooser.setDialogTitle(StringUtil.format(Strings.get("fileLibraryMissingTitle"), file.getName()));
      int action = chooser.showDialog(parent, Strings.get("fileLibraryMissingButton"));
      if (action != JFileChooser.APPROVE_OPTION) {
        throw new LoaderException(Strings.get("fileLoadCanceledError"));
      }
      file = chooser.getSelectedFile();
    }
View Full Code Here


      chooser.setDialogTitle(Strings.get("exportImageDirectorySelect"));
    } else {
      chooser.setFileFilter(filter);
      chooser.setDialogTitle(Strings.get("exportImageFileSelect"));
    }
    int returnVal = chooser.showDialog(frame, Strings.get("exportImageButton"));
    if (returnVal != JFileChooser.APPROVE_OPTION) return;

    // Determine whether destination is valid
    File dest = chooser.getSelectedFile();
    chooser.setCurrentDirectory(dest.isDirectory() ? dest : dest.getParentFile());
View Full Code Here

        JFileChooser chooser = getChooser(title);
        chooser.setFileSelectionMode(fileSelectionMode);
        if (ff != null) {
            chooser.setFileFilter(ff);
        }
        int state = chooser.showDialog(null, acceptButtonText);
        String ret = handleResponse(chooser, state);
        return ret;
    }
   
    public static JFileChooser getChooser(String title) {
View Full Code Here

        chooser.setFileFilter(new ImageLoaderFileFilter(imageReaderLoaders));
        String acceptButtonText = i18n.get(ImageTileLayer.class,
                "acceptButtonText",
                "Add");
        int state = chooser.showDialog(null, acceptButtonText);

        try {
            // only bother trying to read the file if there is one
            // for some reason, the APPROVE_OPTION said it was a
            // boolean during compile and didn't work in this next
View Full Code Here

            //If folder was not set, use default home folder.
            chooser = new JFileChooser();
        }
        chooser.setFileFilter(new LoggingFileFilter(getFileExtensions(),Viewer.instance.getString("fileDescription")));
        //show the fileChooser.
        int result = chooser.showDialog(Viewer.instance, Viewer.instance.getString(type+"Action"));
        //check validation status of the JFileChooser.
        if(result == JFileChooser.APPROVE_OPTION){
            jTextFieldFile.setText(chooser.getSelectedFile().getPath());
        }//if no file has been selected, do nothing.
    }
View Full Code Here

      Java3DPlugin3DFileFilter filter = new Java3DPlugin3DFileFilter();
      JFileChooser chooser = new JFileChooser();
      chooser.setAcceptAllFileFilterUsed(false);
      chooser.setFileFilter(filter);
     
      int returnVal = chooser.showDialog(null, NodeResourcesManager.getResources().getString("SaveAs"));
      if (returnVal == JFileChooser.APPROVE_OPTION){
       
        File f = chooser.getSelectedFile();
        fileName = new String();
        String sceneName = new String();
View Full Code Here

       
   
    import_server_list.addActionListener(new ActionListener() {
       public void actionPerformed(ActionEvent event) {
         System.out.println("Import server list entered");
         file_chooser.showDialog(_this, "Choose");  
       }
    });
   
    new_downloads.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent event) {
View Full Code Here

              fc =((JSynopticPanels)JSynoptic.gui).getFileChooser();
            }else{
              fc = new JFileChooser();
            }
            if (link!=null) fc.setSelectedFile(new File(link));
            int res = fc.showDialog(JSynoptic.gui.getOwner(), messageWriter.print0args("SelectLink"));
            if (res!=JFileChooser.APPROVE_OPTION) return false;
            File f = fc.getSelectedFile();
            if ((f==null) || (!f.exists())) {
              JSynoptic.setStatus(messageWriter.print1args("CannotSetLinkInvalidFile",f.getName()));
              return false;
View Full Code Here

      Java3DPlugin3DFileFilter filter = new Java3DPlugin3DFileFilter();
      JFileChooser chooser = new JFileChooser();
      chooser.setAcceptAllFileFilterUsed(false);
      chooser.setFileFilter(filter);
     
      int returnVal = chooser.showDialog(null, NodeResourcesManager.getResources().getString("Open"));
      if (returnVal == JFileChooser.APPROVE_OPTION){
        loadJava3dScene(chooser.getSelectedFile());
     
    }
  }
View Full Code Here

        if ((fileChooser.getAccessory() != null) && (fileChooser.getAccessory() instanceof FileChooserAccessory)){
            ((FileChooserAccessory)fileChooser.getAccessory()).updateFileChooserAccessory();
        }

        int result = fileChooser.showDialog(owner, dialogText);
        if (result != JFileChooser.APPROVE_OPTION) {
            return null;
        }
        CurrentPathProvider.currentPathProvider.setCurrentPath(fileChooser.getCurrentDirectory());
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.