code: private void _addActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event__addActionPerformed
          JFileChooser fc = new JFileChooser();
          fc.setMultiSelectionEnabled(true);
          fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
          fc.setFileFilter(new FileFilter() {
  
              @Override
              public boolean accept(File f) {
                  return f.isDirectory() || f.getName().endsWith(".R") || f.getName().endsWith(".Rdata");
              }
  
              @Override
              public String getDescription() {
                  return "R object file";
              }
          });
          if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION && fc.getSelectedFiles() != null) {
              File[] files = fc.getSelectedFiles();
              for (File file : files) {
                  if (file.getName().endsWith(".R")) {
                      if (R != null) {
                          R.source(file);
                      }
                  } else if (file.getName().endsWith(".Rdata")) {
                      if (R != null) {
                          R.load(file);
                      }
                  } else {
                      Log.Out.println("Not loading/sourcing " + file.getName());
                  }
              }
          }
          update();
      }
docs: </editor-fold>//GEN-END:initComponents