Choose Directory

if there a way to prompt a user for a directory?

something like the OpenFileDialog but I do not want to open a file. I only want the user to pick a directory then return to the code what the user picked

Lotusscript or Java will work for me.

Subject: use savefiledialog

Subject: Nice

I completely missed that, thanksI know I stated LotusScript or Java and you gave the LotusScript way.

Anyone know of a Java way?

I have tried JFileChooser and a few other methods but all failed in Lotus Notes agents

Subject: found how to do this in Java

import lotus.domino.;import org.eclipse.swt.widgets.;

public class JADirText extends AgentBase {

public void NotesMain() {



  try {

      Session session = getSession();

      AgentContext agentContext = session.getAgentContext();



      String strGetDir = getDirFromUser();

      System.out.println(strGetDir);



  } catch(Exception e) {

      e.printStackTrace();

   }

}

public static String getDirFromUser() 

  {

	String strReturnDir = "";

    Display display = new Display();

    Shell shell = new Shell(display);



    DirectoryDialog dlg = new DirectoryDialog(shell);

                    dlg.setFilterPath("");

                    dlg.setText("Directory Dialog");

                    dlg.setMessage("Select a Directory");



    String dir = dlg.open();

    if(dir != null) 

      {

	   strReturnDir = dir;

      }

    

  return strReturnDir;

}

}

You need this Jar file to make the above code work