Set Filter Path : DirectoryDialog « SWT « Java Tutorial






Set Filter Path
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class DirectoryDialogFilterPath {

  public static void main(String[] args) {
    Display display = new Display();
    final Shell shell = new Shell(display);

    DirectoryDialog dlg = new DirectoryDialog(shell);
    dlg.setFilterPath("C:/");
    
    String selectedDirectory = dlg.open();

    System.out.println(selectedDirectory);
    
    display.dispose();

  }
}








17.104.DirectoryDialog
17.104.1.Creating the dialog and retrieving the selected directoryCreating the dialog and retrieving the selected directory
17.104.2.Set Filter PathSet Filter Path
17.104.3.Customizing the Directory Selection Dialog: set title and messageCustomizing the Directory Selection Dialog: set title and message