I created a SWT Slider the "createControl" method of one class and I need to update that Slider from a separate class. I tried the approach below but got an error when calling slider.setSelection (1)
In the debugger it looks like the slider variable is valid when the reset method is called.

Do I need to take a different approach? Anything else I need to do to the slider variable before calling setSelection?

class where slider is created:

public class ScaleSlider extends WorkbenchWindowControlContribution
{
  private static ScaleSlider instance = null;
  private Slider slider = null;
 
  public ScaleSlider ()
  {
    instance = this;
  }
 
  public static ScaleSlider getInstance()
  {
    return instance;
  }
 
  @Override
  protected Control createControl(Composite parent)
  {
    Composite composite = new Composite(parent, SWT.NONE);
    slider = new Slider(composite, SWT.HORIZONTAL);
  }
 
  public void reset()
  {
    if (slider != null)
       slider.setSelection(1);
  }
}

separate class that needs to update the slider:
public class separateClass
{
  public void resetScale()
  {
    if (ScaleSlider.getInstance() != null)
      ScaleSlider.getInstance().reset();
  }
}

NOTE: I'm using eclipse.swt.widgets.... so this may not be the best forum for my problem.