Package java.awt

Examples of java.awt.FileDialog.showDialog()


        }
      };
      chooser.setDialogTitle(title);
      chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);

      int returnVal = chooser.showDialog(c, approveButtonText);
      if(returnVal == JFileChooser.APPROVE_OPTION)
        return chooser.getSelectedFile();
    }

    return null;
View Full Code Here


            open.setDialogType(isOpen ? JFileChooser.OPEN_DIALOG : JFileChooser.SAVE_DIALOG);
            if (ext.length()>0) open.setFileFilter(new FileFilter() {
               public boolean accept(File file) { return !file.isFile() || file.getPath().toLowerCase(Locale.US).endsWith(ext); }
               public String getDescription() { return description; }
            });
            if (open.showDialog(null, null) != JFileChooser.APPROVE_OPTION || open.getSelectedFile() == null) return null;
            ans = open.getSelectedFile().getPath();
         } catch(Exception ex) {
            // Some combination of Windows version and JDK version will trigger this failure.
            // In such a case, we'll fall back to using the "AWT" file open dialog
            useAWT = true;
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.