if(!result.equals("")) {
if(result != null) {
  public AccountDialog(Display display, TrackDatabase trackDatabase, DownloadThread downloadThread) {    this.shell = new Shell(display);    this.trackDatabase = trackDatabase;    this.downloadThread = downloadThread;    shell.addShellListener(new ShellAdapter() {      public void shellClosed(ShellEvent e) {        done = true;      }    });    shell.setText("Account Settings");    GridLayout layout = new GridLayout(3, false);    shell.setLayout(layout);//    new Label(shell, SWT.NONE).setText(//      "Please choose a User name and password. If\n"//        + "the User does not exist it will be created.");      createUserInfo();    new Label(shell, SWT.NONE).setText("Password");    txtPassword = new Text(shell, SWT.SINGLE | SWT.BORDER);    GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);    data.horizontalSpan = 2;    txtPassword.setLayoutData(data);String password = trackDatabase.getPassword();    if (password.length() == 0)      password = randomString(10);    txtPassword.setText(password);    new Label(shell, SWT.NONE).setText("Server");    txtServer = new Text(shell, SWT.SINGLE | SWT.BORDER);    data = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);    data.horizontalSpan = 2;    txtServer.setLayoutData(data);    txtServer.setText(trackDatabase.getHost());    new Label(shell, SWT.NONE).setText("Port");    txtPort = new Text(shell, SWT.SINGLE | SWT.BORDER);    data = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);    data.horizontalSpan = 2;    txtPort.setLayoutData(data);    txtPort.setText(Integer.toString(trackDatabase.getPort()));        new Label(shell, SWT.NONE).setText("Directory");    txtDirectory = new Text(shell, SWT.SINGLE | SWT.BORDER);    data = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);    data.horizontalSpan = 1;    data.widthHint = 200;    txtDirectory.setEnabled(false);    txtDirectory.setLayoutData(data);    txtDirectory.setText(System.getProperties().getProperty("user.home"));    Button btnDirectory = new Button(shell, SWT.NONE);    btnDirectory.setText("Browse...");    btnDirectory.addSelectionListener(new SelectionAdapter() {      public void widgetSelected(SelectionEvent e) {        DirectoryDialog dialog = new DirectoryDialog (shell);        dialog.setMessage("Choose the location for iRATE downloads -- The directory 'irate' will be created in this location");        String result = dialog.open();        if(!result.equals("")) {          txtDirectory.setText(result);        }      }    });        Button btnCancel = new Button(shell, SWT.NONE);    btnCancel.setText("Cancel");    btnCancel.addSelectionListener(new SelectionAdapter() {      public void widgetSelected(SelectionEvent e) {        done = true;      }    });    createAcceptButton();    shell.addShellListener(new ShellAdapter() {      public void shellClosed(ShellEvent e) {        done = true;      }    });    shell.pack();    Point size = shell.getSize();    if (size.x < 320)      size.x = 320;    shell.setSize(size);//    shell.setLocation();        shell.open();    while (!done) {      if (!display.readAndDispatch())        display.sleep();    }    shell.close();    shell.dispose();    if (!success)      System.exit(0);  }