errorDialog.showURL(url);
final URL final_url=url; display.asyncExec(new Runnable() { public void run() { errorDialog.showURL(final_url); } });
  public Client() {    File home = new File(System.getProperties().getProperty("user.home"));      // Check the current directory for an existing trackdatabase.xml for      // compatibility reasons only.        File file = new File("trackdatabase.xml");        if (!file.exists()) {      File dir = new File(home, "irate");      if (!dir.exists())        dir.mkdir();      file = new File(dir, "trackdatabase.xml");    }      try {      trackDatabase = new TrackDatabase(file);    }    catch (IOException e) {      e.printStackTrace();    }      playerList = new PlayerList();      //try to do a nice initial experience for theuser      //do as much handholding as possible    if(!file.exists())    {      new AccountDialog(display, trackDatabase);      Player players[] = playerList.getPlayers();      trackDatabase.setAutoDownload(2);      if(players.length > 0)        trackDatabase.setPlayer(players[0].getName());          }    playListManager = new PlayListManager(trackDatabase);    playThread = new PlayThread(playListManager, playerList);     initGUI();    errorDialog = new ErrorDialog(display, shell);        if (playerList.getPlayers().length == 0)       errorDialog.showURL(getResource("help/missingplayer.html"));    playThread.addUpdateListener(this);    playThread.start();                downloadThread = new DownloadThread(trackDatabase) {      public void process() throws IOException {        super.process();       // perhapsDisableAccount();      }      public void handleError(String code, String urlString) {        //actionSetContinuousDownload(false);        URL url;        if (urlString.indexOf(':') < 0)          url = getClass().getResource("help/" + urlString);        else           try {            url = new URL(urlString);          }          catch (MalformedURLException e) {            e.printStackTrace();            url = getResource("help/malformedurl.html");          }        errorDialog.showURL(url);      }    };        downloadThread.addUpdateListener(new UpdateListener() {      boolean newState = false;      public void actionPerformed() {        String state = downloadThread.getState();        newState = false;        if (!strState.equals(state)) {          strState = state;          newState = true;        }        display.asyncExec(new Runnable() {          public void run() {            int n = downloadThread.getPercentComplete();            boolean barVisible = progressBar.getVisible();            if(n > 0 && n < 100)            {              lblState.setText(strState + " "+n +"%");              progressBar.setSelection(n);              if(!barVisible)                progressBar.setVisible(true);            }else             {              lblState.setText(strState);                          if(barVisible)                progressBar.setVisible(false);            }            lblState.pack();            if(newState)              synchronizePlaylist(playListManager, tblSongs);          }        });      }    });    downloadThread.start();      //if this is the first run of irate do that    if(!file.exists())      downloadThread.go();  }