String volumeLevel = Preferences.getUserPreference("volumeLevel"); if(volumeLevel != null) { setVolumeSlider(new Integer(volumeLevel).intValue()); setPlayerVolume(getVolumeSlider());
String volumeLevelStr = Preferences.getUserPreference("volumeLevel"); if (volumeLevelStr != null) { final int volumeLevel = Integer.parseInt(volumeLevelStr); setPlayerVolume(volumeLevel);    display.asyncExec(new Runnable() { public void run() { setVolumeSlider(volumeLevel); } });
  public void run() {    trackTable.updateTable();    topPanel.layout();        shell.layout();        String maximize = Preferences.getUserPreference("isMaximized");           String length = Preferences.getUserPreference("shellLength");    String height = Preferences.getUserPreference("shellHeight");    if(length != null && height != null) {      shell.setSize(new Integer(length).intValue(),new Integer(height).intValue());    }        String xLocation = Preferences.getUserPreference("shellX");    String yLocation = Preferences.getUserPreference("shellY");        if(xLocation != null && yLocation != null) {        shell.setLocation(new Integer(xLocation).intValue(),new Integer(yLocation).intValue());      }        if(maximize != null && maximize.equals("true")) {        shell.setMaximized(true);    }            String volumeLevel = Preferences.getUserPreference("volumeLevel");    if(volumeLevel != null) {      setVolumeSlider(new Integer(volumeLevel).intValue());      setPlayerVolume(getVolumeSlider());    }        shell.open();       // Remember the sort order of the track table.  This has to be here.    // The shell needs to be open before the sort will work propertly.    String sortColumn = Preferences.getUserPreference("sortColumn");    String sortDirection = Preferences.getUserPreference("sortDirection");        if(sortDirection == null) {        sortDirection = "true";    }        if(sortColumn != null) {        trackTable.setSortColumn(new Integer(sortColumn).intValue(),new Boolean(sortDirection).booleanValue());    }        downloadThread.start();    trackTable.addSelectionListener(new SelectionAdapter() {        // Play track if the user double-clicks on it (or whatever the equivalent        // is on the target platform).      public void widgetDefaultSelected(SelectionEvent e) {        Track track = trackTable.getClickedTrack();        if ((track != null) && track.exists()) {          setPaused(false);          playThread.play(track);        }      }    });    setPaused(false);    playThread.start();        while (true) {      if (!display.readAndDispatch()) {        display.sleep();      }    }             }