Package javax.swing

Examples of javax.swing.JFileChooser.showDialog()


      JFileChooser chooser = new JFileChooser(".");
      chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
      chooser.setAcceptAllFileFilterUsed(false);

      if (chooser.showDialog(this.view.getFrame(), "Select output directory.") == JFileChooser.APPROVE_OPTION) {
        outPutFolder = chooser.getSelectedFile().getAbsolutePath()
            + "/";
        outPutFolder = outPutFolder.replace(File.separatorChar, '/');
      } else {
        return;
View Full Code Here


    JFileChooser chooser = new JFileChooser(
        "src/main/resources/htmlTemplates");
    chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
    chooser.setFileFilter(new FileNameExtensionFilter("json", "json"));
    chooser.setAcceptAllFileFilterUsed(false);
    if (chooser.showDialog(this.view.getFrame(), "Open") == JFileChooser.APPROVE_OPTION) {
      load(chooser.getSelectedFile());
    }
  }

  /**
 
View Full Code Here

     */
    @Override
    public void actionPerformed(ActionEvent e) {
        //PanelExperimentos motorExperimentos = PanelExperimentos.getInstance();
        JFileChooser fcAbrir = new JFileChooser();
        int res = fcAbrir.showDialog(Practica1.getInstance(),
                Language.getI().getP("ABRIR_EXPERIMENTO"));

        if(res == JFileChooser.APPROVE_OPTION) {
            File fichAbrir = fcAbrir.getSelectedFile();
           
View Full Code Here

      }

      while (true)
      {

         int intReturnValue = jfc.showDialog(cmpFrameParent, strApproveButtonText);

         // ----
         // either "cancel" or "windowClosing"
         if (intReturnValue != 0)
         {
View Full Code Here

         String strBody = "An error occured, the application will exit.";
         JOptionPane.showMessageDialog(cmpFrameParent, strBody, GfrResBundleLang.s_getInstance().getValue("word.error"), JOptionPane.ERROR_MESSAGE);
         System.exit(1);
      }

      int intReturnValue = jfc.showDialog(cmpFrameParent, strButtonTxt);

      // ----
      // either "cancel" or "windowClosing"
      if (intReturnValue != 0)
      {
View Full Code Here

         String strBody = "An error occured, the application will exit.";
         JOptionPane.showMessageDialog(cmpFrameParent, strBody, GfrResBundleLang.s_getInstance().getValue("word.error"), JOptionPane.ERROR_MESSAGE);
         System.exit(1);
      }

      int intReturnValue = jfc.showDialog(cmpFrameParent, strApproveButtonText);

      // ----
      // either "cancel" or "windowClosing"
      if (intReturnValue != 0)
      {
View Full Code Here

    private static String getPathToExec(Component parent, String dialogText) throws HeadlessException {
        String pathToExec = null;
        JFileChooser fileChooser = new JFileChooser();
        fileChooser.setDialogTitle(dialogText);
        if (fileChooser.showDialog(parent, "Choose") == JFileChooser.APPROVE_OPTION) {
            pathToExec = fileChooser.getSelectedFile().getAbsolutePath();
        }
        return pathToExec;
    }
View Full Code Here

   */
  void showSavePathDialog() {

    JFileChooser myChooser = new JFileChooser();
    myChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    int button = myChooser.showDialog(this, GT._("Select"));
    if (button == JFileChooser.APPROVE_OPTION) {
      java.io.File newFile = myChooser.getSelectedFile();
      String savePath;
      if (newFile.isDirectory()) {
        savePath = newFile.toString();
View Full Code Here

   * Show a file selector when the savePath button is pressed.
   */
  void showPovrayPathDialog() {

    JFileChooser myChooser = new JFileChooser();
    int button = myChooser.showDialog(this, GT._("Select"));
    if (button == JFileChooser.APPROVE_OPTION) {
      java.io.File newFile = myChooser.getSelectedFile();
      povrayPathLabel.setText(newFile.toString());
      updateCommandLine();
      pack();
View Full Code Here

        FileNameExtensionFilter fileNameExtensionFilter = new FileNameExtensionFilter(
            "Arquivos DFP", "dfp");
        jfc.addChoosableFileFilter(fileNameExtensionFilter);

        if (jfc.showDialog(null, "Abrir") == JFileChooser.APPROVE_OPTION) {
          if (!controller.isNomeArquivoValido(jfc.getSelectedFile()
              .getName())) {
            JOptionPane.showMessageDialog(ViewFrame2.this,
                "Arquivo inv�lido!", "Erro",
                JOptionPane.ERROR_MESSAGE);
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.