Package javax.swing

Examples of javax.swing.JFileChooser.showOpenDialog()


            }

            public void actionPerformed(ActionEvent e) {
                JFileChooser fc = ImportFormats.createImportFileChooser
                        (Globals.prefs.get("importWorkingDirectory"));
                fc.showOpenDialog(frame);
                File file = fc.getSelectedFile();
                if (file == null)
                    return;
                FileFilter ff = fc.getFileFilter();
                ImportFormat format = null;
View Full Code Here


            }

            public void actionPerformed(ActionEvent e) {
                JFileChooser fc = ImportFormats.createImportFileChooser
                        (Globals.prefs.get("importWorkingDirectory"));
                fc.showOpenDialog(frame);
                File file = fc.getSelectedFile();
                if (file == null)
                    return;
                FileFilter ff = fc.getFileFilter();
                ImportFormat format = null;
View Full Code Here

  }//GEN-LAST:event_quitMenuAction


  private void loadMenuAction(java.awt.event.ActionEvent evt) {
    JFileChooser chooser = new JFileChooser();
    int returnVal = chooser.showOpenDialog(this);
    if(returnVal == JFileChooser.APPROVE_OPTION) {
      try {
        memoFromFile(chooser.getSelectedFile());
      }
      catch (Exception e) { showException(this,e); }
View Full Code Here

        // BROWSE_BUTTON
        browseDestButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JFileChooser fileChooser = SharedJFileChooser.getInstance(SharedJFileChooserType.PDF_FILE,
                        JFileChooser.FILES_ONLY, destinationTextField.getText());
                if (fileChooser.showOpenDialog(browseDestButton.getParent()) == JFileChooser.APPROVE_OPTION) {
                    File chosenFile = fileChooser.getSelectedFile();
                    if (chosenFile != null) {
                        destinationTextField.setText(chosenFile.getAbsolutePath());
                    }
                }
View Full Code Here

            JFileChooser chooser = new JFileChooser(new File("."));
            chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
            chooser.setMultiSelectionEnabled(true);
            chooser.setDialogTitle("Choose File to Compile");
            chooser.setFileFilter(chooserFileFilter);
            if(chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {              
                File[] flist = chooser.getSelectedFiles();
                if (flist != null && flist.length != 0){
                    try {
                        for (int i=0; i<flist.length; i++){
                            File f = flist[i].getCanonicalFile();
View Full Code Here

        fileChooser.setFileHidingEnabled(true);
        fileChooser.setDialogType(JFileChooser.OPEN_DIALOG);
        // TODO Language
        fileChooser.setDialogTitle("Choose directory");
        fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        int selection = fileChooser.showOpenDialog(parent);
        if (selection == JFileChooser.APPROVE_OPTION) {
            result = fileChooser.getSelectedFile();
        }
        return result;
    }
View Full Code Here

   */
  private void onPacourir() {
    JFileChooser chooser = new JFileChooser(); //cr�ation dun nouveau filechooser
    chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
    chooser.setApproveButtonText(LangageManager.getProperty("common.dialog.select")); //intitul� du bouton
    if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION)
      getJTextField_MediaPlayer().setText(chooser.getSelectedFile().getAbsolutePath());
  }

  public JButton getButton() {
    return new JButton(LangageManager.getProperty("generaloptionpanel.button"), IMAGE);
View Full Code Here

        return current;
      }
    }
    JFileChooser chooser = new JFileChooser();
    chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    int result = chooser.showOpenDialog(null);
    if (result == JOptionPane.OK_OPTION) {
      return chooser.getSelectedFile();
    }
    return null;
  }
View Full Code Here

        for (int i = 0; i < filefilters.length; i++) {
            fc.removeChoosableFileFilter(filefilters[i]);
        }
        fc.addChoosableFileFilter(ganttFilter);

        int returnVal = fc.showOpenDialog(myWorkbenchFacade.getMainFrame());
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            final JFileChooser jfc = fc;
            Document document = getDocumentManager().getDocument(
                    jfc.getSelectedFile().getAbsolutePath());
            openProject(document, project);
View Full Code Here

    public File show() {
        File result = null;
        JFileChooser fc = new JFileChooser(myStartDirectory);
        fc.addChoosableFileFilter(new GanttXMLFileFilter());

        int returnVal = fc.showOpenDialog(null);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            result = fc.getSelectedFile();
        }
        return result;
    }
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.