Package javax.swing

Examples of javax.swing.JFileChooser.showDialog()


        "Choose icon for '{0}'", markList.getName()));

    Window w = UiUtilities.getLastModalChildOf(SimpleMarkerPlugin
        .getInstance().getSuperFrame());

    if (chooser.showDialog(w, Localizer.getLocalization(Localizer.I18N_SELECT)) == JFileChooser.APPROVE_OPTION) {
      if (chooser.getSelectedFile() != null) {
        File dir = new File(Plugin.getPluginManager().getTvBrowserSettings().getTvBrowserUserHome(),"simplemarkericons");

        if(!dir.isDirectory()) {
          dir.mkdir();
View Full Code Here


            : userPrefs.get(LAST_FILE_NAME_CHOOSEN_KEY, "./");
    File directory = (lastFileName.length() > 0) ? new File(lastFileName).getParentFile()
            : new File("./");
    fileChooser.setCurrentDirectory(directory);
    fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
    int result = fileChooser.showDialog(new JFrame(), "Select");
    if (result == JFileChooser.APPROVE_OPTION) {
      selectedFileName = fileChooser.getSelectedFile().getAbsolutePath();
      pearFileTextField.setText(selectedFileName);
      installButton.setEnabled(true);
      // save state of the window
View Full Code Here

    String selectedDirName = null;
    File directory = (lastDirName.length() > 0) ? new File(lastDirName).getParentFile() : new File(
            "./");
    fileChooser.setCurrentDirectory(directory);
    fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    int result = fileChooser.showDialog(new JFrame(), "Select");
    // User selects the 'Select Button'
    if (result == JFileChooser.APPROVE_OPTION) {
      selectedDirName = fileChooser.getSelectedFile().getAbsolutePath();
      // saving the state of the window
      try {
View Full Code Here

        chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        lastDir.updateChooser(chooser);

        chooser.addChoosableFileFilter(FileFilters.getDataMapFilter());

        int status = chooser.showDialog(f, "Select DataMap");
        if (status == JFileChooser.APPROVE_OPTION) {
            File file = chooser.getSelectedFile();

            // save to preferences...
            lastDir.updateFromChooser(chooser);
View Full Code Here

        }

        JFileChooser fileChooser = new JFileChooser();
        fileChooser.setSelectedFile(new File(filename));

        int chooseResult = fileChooser.showDialog(component, "Download");
        if (chooseResult == JFileChooser.APPROVE_OPTION) {
            try {
                storeStream(content.getStream(), fileChooser.getSelectedFile());
            } catch (Exception e) {
                showError(component, e);
View Full Code Here

    public static void copy(Component component, File file) {
        JFileChooser fileChooser = new JFileChooser();
        fileChooser.setSelectedFile(new File(file.getName()));

        int chooseResult = fileChooser.showDialog(component, "Download");
        if (chooseResult == JFileChooser.APPROVE_OPTION) {
            try {
                storeStream(new FileInputStream(file), fileChooser.getSelectedFile());
            } catch (Exception e) {
                showError(component, e);
View Full Code Here

        JButton browseButton = new JButton("Browse");
        browseButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                JFileChooser fileChooser = new JFileChooser();
                int chooseResult = fileChooser.showDialog(filenameField, "Select");
                if (chooseResult == JFileChooser.APPROVE_OPTION) {
                    if (fileChooser.getSelectedFile().isFile()) {
                        setFile(fileChooser.getSelectedFile());
                    }
                }
View Full Code Here

        JButton browseButton = new JButton("Browse");
        browseButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                JFileChooser fileChooser = new JFileChooser();
                int chooseResult = fileChooser.showDialog(filenameField, "Select");
                if (chooseResult == JFileChooser.APPROVE_OPTION) {
                    if (fileChooser.getSelectedFile().isFile()) {
                        setFile(fileChooser.getSelectedFile());
                    }
                }
View Full Code Here

        }

        JFileChooser fileChooser = new JFileChooser();
        fileChooser.setSelectedFile(new File(filename));

        int chooseResult = fileChooser.showDialog(component, "Download");
        if (chooseResult == JFileChooser.APPROVE_OPTION) {
            try {
                storeStream(content.getStream(), fileChooser.getSelectedFile());
            } catch (Exception e) {
                showError(component, e);
View Full Code Here

    public static void copy(Component component, File file) {
        JFileChooser fileChooser = new JFileChooser();
        fileChooser.setSelectedFile(new File(file.getName()));

        int chooseResult = fileChooser.showDialog(component, "Download");
        if (chooseResult == JFileChooser.APPROVE_OPTION) {
            try {
                storeStream(new FileInputStream(file), fileChooser.getSelectedFile());
            } catch (Exception e) {
                showError(component, e);
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.