Package javax.swing

Examples of javax.swing.JFileChooser


  protected void load()
  {
    setStatusText(resources.getString("ConfigEditor.USER_LOADING_FILE")); //$NON-NLS-1$
    if (fileChooser == null)
    {
      fileChooser = new JFileChooser();
      final FilesystemFilter filter = new FilesystemFilter
          (ConfigEditor.PROPERTIES_FILE_EXTENSION, resources.getString(
              "config-editor.file-description.properties")); //$NON-NLS-1$
      fileChooser.addChoosableFileFilter(filter);
      fileChooser.setMultiSelectionEnabled(false);
View Full Code Here


    setStatusText(resources.getString("ConfigEditor.USER_SAVING")); //$NON-NLS-1$
    editorPane.commit();

    if (fileChooser == null)
    {
      fileChooser = new JFileChooser();
      final FilesystemFilter filter = new FilesystemFilter
          (ConfigEditor.PROPERTIES_FILE_EXTENSION, resources.getString(
              "config-editor.file-description.properties")); //$NON-NLS-1$
      fileChooser.addChoosableFileFilter(filter);
      fileChooser.setMultiSelectionEnabled(false);
View Full Code Here

    setContentPane(cPaneStatus);
    setEntryType(ConfigDescriptionEditor.TYPE_TEXT);
    setSelectedEntry(null);

    fileChooser = new JFileChooser();
    fileChooser.addChoosableFileFilter(new FilesystemFilter
        (".xml", resources.getString("config-description-editor.xml-files"))); //$NON-NLS-1$ //$NON-NLS-2$
    fileChooser.setMultiSelectionEnabled(false);

    setStatusText(resources.getString("config-description-editor.welcome")); //$NON-NLS-1$
View Full Code Here

import com.bbn.openmap.Environment;

public class FileUtils {

    public static String getFilePathToSaveFromUser(String title) {
        JFileChooser chooser = getChooser(title);
        int state = chooser.showSaveDialog(null);
        String ret = handleResponse(chooser, state);
        return ret;
    }
View Full Code Here

    public static String getFilePathToOpenFromUser(String title) {
        return getFilePathToOpenFromUser(title, null);
    }

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

        String ret = handleResponse(chooser, state);
        return ret;
    }

    public static String getPathToOpenFromUser(String title, FileFilter ff, int fileSelectionMode, String acceptButtonText) {
        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;
    }
View Full Code Here

   
    public static JFileChooser getChooser(String title) {
        // setup the file chooser
        File startingPoint = new File(Environment.get("lastchosendirectory",
                System.getProperty("user.home")));
        JFileChooser chooser = new JFileChooser(startingPoint);
        chooser.setDialogTitle(title);
        return chooser;
    }
View Full Code Here

    public boolean supportsCustomEditor() {
        return true;
    }

    public void actionPerformed(ActionEvent e) {
        JFileChooser chooser = getFileChooser();
        int returnVal = chooser.showOpenDialog((Component) null);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            String newFilename = chooser.getSelectedFile().getAbsolutePath();
            newFilename = cleanUpName(newFilename);
            textField.setText(newFilename);
            firePropertyChange();
        }
    }
View Full Code Here

        jp.add(button);
        return jp;
    }

    public JFileChooser getFileChooser() {
        JFileChooser chooser = new JFileChooser(getLastLocation());
        chooser.setFileSelectionMode(getFileSelectionMode());
        chooser.setMultiSelectionEnabled(isMultiSelectEnabled());
        return chooser;
    }
View Full Code Here

    public char getPathSeparator() {
        return pathSeparator;
    }

    public void actionPerformed(ActionEvent e) {
        JFileChooser chooser = getFileChooser();
        int returnVal = chooser.showOpenDialog((Component) null);
        if (returnVal == JFileChooser.APPROVE_OPTION) {

            File[] choices = chooser.getSelectedFiles();
            for (int i = 0; i < choices.length; i++) {
                String newFilename = choices[i].getAbsolutePath();
                newFilename = cleanUpName(newFilename);
                append(newFilename);
            }
View Full Code Here

TOP

Related Classes of javax.swing.JFileChooser

Copyright © 2018 www.massapicom. 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.