Examples of showOpenDialog()


Examples of javax.swing.JFileChooser.showOpenDialog()

   
    btnLoc.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        JFileChooser fc = new JFileChooser(location);
        fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        int res = fc.showOpenDialog(PackagesPanel.this.installer);
        if (res==JFileChooser.APPROVE_OPTION) {
          // first choose selection
          location = fc.getSelectedFile();
          // if user entered directory but no selection, choose it instead
          if (location==null) location = fc.getCurrentDirectory();
View Full Code Here

Examples of javax.swing.JFileChooser.showOpenDialog()

                }
                public String getDescription() {
                    return "XYZ result files (*.xyz)";
                }
            });
            int ret = chooser.showOpenDialog(null);
            if (ret == JFileChooser.APPROVE_OPTION) {
                try {
          load(chooser.getSelectedFile());
        } catch (IOException e) {
          JOptionPane.showMessageDialog(null, e.getLocalizedMessage(), "Can't load "+chooser.getSelectedFile(),JOptionPane.ERROR_MESSAGE);
View Full Code Here

Examples of javax.swing.JFileChooser.showOpenDialog()

  private void chooseBrowser() throws RegainException {
    JFileChooser fileChooser = new JFileChooser();
   
    String msg = mLocalizer.msg("chooseBrowser", "Choose browser");
    fileChooser.setDialogTitle(msg);
    fileChooser.showOpenDialog(mFrame);

    File file = fileChooser.getSelectedFile();
    if (file != null) {
      Document desktopDoc = XmlToolkit.loadXmlDocument(DESKTOP_CONFIG_FILE);
      Element desktopConfig = desktopDoc.getDocumentElement();
View Full Code Here

Examples of javax.swing.JFileChooser.showOpenDialog()

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

Examples of javax.swing.JFileChooser.showOpenDialog()

    }// </editor-fold>//GEN-END:initComponents

    private void buttonBrowseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonBrowseActionPerformed
        final JFileChooser chooser = new JFileChooser();
        if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION)
        {
            try {
                textFile.setText(chooser.getSelectedFile().getCanonicalPath());
            } catch (IOException ex) {
                ErrorDialog.showError(this, ex);
View Full Code Here

Examples of javax.swing.JFileChooser.showOpenDialog()

     
    }//GEN-LAST:event_buttonChooseCaptureDeviceActionPerformed

    private void buttonBrowseFileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonBrowseFileActionPerformed
    final JFileChooser chooser = new JFileChooser();
    if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION)
    {
      final String path = URLUtils.createUrlStr(chooser.getSelectedFile());
      textFieldURL.setText(path);
    }
    }//GEN-LAST:event_buttonBrowseFileActionPerformed
View Full Code Here

Examples of javax.swing.JFileChooser.showOpenDialog()

    /** debug - parse the atom chosen by user
     */
    public static void main (String[] args) {
        JFileChooser chooser = new JFileChooser ();
        int response = chooser.showOpenDialog(null);
        if (response == JFileChooser.CANCEL_OPTION)
            return;
        File f = chooser.getSelectedFile();
        try {
            ParsedAtom[] atomTree = parseAtoms (f);
View Full Code Here

Examples of javax.swing.JFileChooser.showOpenDialog()

      File mediaFile = null;

      JFileChooser chooser = new JFileChooser(getChooserRoot());
      chooser.addChoosableFileFilter(new MixFileFilter());

      int rc = chooser.showOpenDialog(SimpleMixer.this);

      if (rc == JFileChooser.APPROVE_OPTION) {
    mediaFile = chooser.getSelectedFile();
    if (mediaFile != null) {
        MediaLocator ml = null;
View Full Code Here

Examples of javax.swing.JFileChooser.showOpenDialog()

  }
 
  public void onOpenFile()
  {
    final JFileChooser chooser = new JFileChooser();
    if (chooser.showOpenDialog(PlayerPanel.this) ==JFileChooser.APPROVE_OPTION)
    {
      final String urlStr = URLUtils.createUrlStr(chooser.getSelectedFile());
      addMediaLocatorAndLoad(urlStr);
    }
  }
View Full Code Here

Examples of javax.swing.JFileChooser.showOpenDialog()

         {
            chooser.setCurrentDirectory(new File(dirName));
         }
      }
      _sqlPanelAPI.getSession().selectMainTab(ISession.IMainPanelTabIndexes.SQL_TAB);
      if (chooser.showOpenDialog(frame) == JFileChooser.APPROVE_OPTION)
      {
          result = true;
         File selectedFile = chooser.getSelectedFile();
         if (!appendToExisting) {
             _sqlPanelAPI.setEntireSQLScript("");
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.