Package javax.swing

Examples of javax.swing.JFileChooser.showDialog()


        //
        else if (s.equals(SELECT_WORKING_DIR)) {
            JFileChooser fdo = new JFileChooser();
            fdo.setCurrentDirectory(new File(fEnv.getWorkingDirectory()));
            fdo.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
            int fileGotten = fdo.showDialog(this, SELECT);
            if (fileGotten == JFileChooser.APPROVE_OPTION) {
                File file = fdo.getSelectedFile();
                String fNa = file.toString();
                workingDirField.setText(fNa);
            }
View Full Code Here


            }
        } else if (s.equals(SELECT_TEMP_DIR)) {
            JFileChooser fdo = new JFileChooser();
            fdo.setCurrentDirectory(new File(fEnv.getUserHome()));
            fdo.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
            int fileGotten = fdo.showDialog(this, SELECT);
            if (fileGotten == JFileChooser.APPROVE_OPTION) {
                File file = fdo.getSelectedFile();
                String fNa = file.toString();
                tempDirField.setText(fNa);
            }
View Full Code Here

            }
        } else if (s.equals(SELECT_DS_DIR)) {
            JFileChooser fdo = new JFileChooser();
            fdo.setCurrentDirectory(new File(fEnv.getIndexDirectory()));
            fdo.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
            int fileGotten = fdo.showDialog(this, SELECT);
            if (fileGotten == JFileChooser.APPROVE_OPTION) {
                File file = fdo.getSelectedFile();
                String fNa = file.toString();
                dsDirField.setText(fNa);
            }
View Full Code Here

                }
            }
        } else if (s.equals(BROWSE)) {
            JFileChooser fdo = new JFileChooser();
            fdo.setCurrentDirectory(new File(fEnv.getUserHome()));
            int fileGotten = fdo.showDialog(this, SELECT);
            if (fileGotten == JFileChooser.APPROVE_OPTION) {
                File file = fdo.getSelectedFile();
                String fNa = file.toString();
                if (fNa.toLowerCase().endsWith(".zip"))
                    urlOrFile.setText(fNa);
View Full Code Here

          // Adds filter that accepts all supported image formats
          fc.addChoosableFileFilter(new DefaultFileFilter.ImageFileFilter(
              mxResources.get("allImages")));
          fc.setFileFilter(defaultFilter);
          int rc = fc.showDialog(null, mxResources.get("save"));
          dialogShown = true;

          if (rc != JFileChooser.APPROVE_OPTION)
          {
            return;
View Full Code Here

                "Graph Drawing  " + mxResources.get("file")
                    + " (.txt)"));

            fc.setFileFilter(defaultFilter);

            int rc = fc.showDialog(null,
                mxResources.get("openFile"));

            if (rc == JFileChooser.APPROVE_OPTION)
            {
              lastDir = fc.getSelectedFile().getParent();
View Full Code Here

        // Adds file filter for Dia shape import
        fc.addChoosableFileFilter(new DefaultFileFilter(".shape",
            "Dia Shape " + mxResources.get("file") + " (.shape)"));

        int rc = fc.showDialog(null, mxResources.get("importStencil"));

        if (rc == JFileChooser.APPROVE_OPTION)
        {
          lastDir = fc.getSelectedFile().getParent();
View Full Code Here


    private void doOpen() {
        JFileChooser fdo = new JFileChooser();
        fdo.setCurrentDirectory(new File(defaultSaveFolder));
        int fileGotten = fdo.showDialog(this, I18n.getString("button.open"));
        if (fileGotten == JFileChooser.APPROVE_OPTION) {
            File file = fdo.getSelectedFile();
            String fileName = file.toString();
            // get document stream and save it
            if (!fileName.startsWith("http")) {
View Full Code Here

        }
        saveName = FileUtils.addFolder(defaultSaveFolder, saveName);
        fds.setCurrentDirectory(new File(defaultSaveFolder));
        fds.setSelectedFile(new File(saveName));

        int fileGotten = fds.showDialog(this, I18n.getString("button.save"));
        if (fileGotten == JFileChooser.APPROVE_OPTION) {
            File saveFile = fds.getSelectedFile();
            setStatus(I18n.getString("button.save") + saveFile);

            // get document stream and save it
View Full Code Here


    private void getSeachLogReport() {
        JFileChooser fdo = new JFileChooser();
        fdo.setCurrentDirectory(new File(fEnv.getWorkingDirectory()));
        int fileGotten = fdo.showDialog(this, I18n.getString("select"));
        if (fileGotten == JFileChooser.APPROVE_OPTION) {
            File file = fdo.getSelectedFile();
            try {
                LogAnalysis.doLogAnalysis(this, file.toString());
            }
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.