m_resources = resources;
  public SamplingControlPanel(Resources resources) {    m_resources = resources;    m_sampleIntervalString =      resources.getString("sampleInterval.label") + " ";    m_ignoreSampleString = resources.getString("ignoreCount.label") + " ";    m_collectSampleZeroString =      resources.getString("collectCountZero.label", false);    m_collectSampleString =      resources.getString("collectCount.label") + " ";    m_msUnit = " " + resources.getString("ms.unit");    m_msUnits = " " + resources.getString("ms.units");    m_sampleUnit = " " + resources.getString("sample.unit");    m_sampleUnits = " " + resources.getString("sample.units");    m_intervalSlider.setMajorTickSpacing(1000);    m_intervalSlider.setMinorTickSpacing(100);    m_intervalSlider.setPaintTicks(true);    m_intervalSlider.setSnapToTicks(true);    final JLabel intervalLabel = new JLabel();    m_intervalSlider.addChangeListener(      new ChangeListener() {	public void stateChanged(ChangeEvent event) {	  final int value = m_intervalSlider.getValue();	  setIntervalLabelText(intervalLabel, value);	  if (m_properties != null) {	    try {		      m_properties.setSampleInterval(value);	    }	    catch (ConsoleException e) {	      assertionFailure(e);	    }	  }	}      }      );    final JLabel ignoreSampleLabel = new JLabel();    m_ignoreSampleField.addChangeListener(      new ChangeListener() {	public void stateChanged(ChangeEvent event) {	  final int value = m_ignoreSampleField.getValue();				  setIgnoreSampleLabelText(ignoreSampleLabel, value);	  if (m_properties != null) {	    try {	      m_properties.setIgnoreSampleCount(value);	    }	    catch (ConsoleException e) {	      assertionFailure(e);	    }	  }	}      }      );    final JLabel collectSampleLabel = new JLabel();    m_collectSampleField.addChangeListener(      new ChangeListener() {	public void stateChanged(ChangeEvent event) {	  final int value = m_collectSampleField.getValue();				  setCollectSampleLabelText(collectSampleLabel, value);	  if (m_properties != null) {	    try {	      m_properties.setCollectSampleCount(value);	    }	    catch (ConsoleException e) {	      assertionFailure(e);	    }	  }	}      }      );    final JPanel textFieldLabelPanel = new JPanel(new GridLayout(0, 1, 0, 1));    textFieldLabelPanel.add(ignoreSampleLabel);    textFieldLabelPanel.add(collectSampleLabel);    final JPanel textFieldControlPanel =      new JPanel(new GridLayout(0, 1, 0, 1));    textFieldControlPanel.add(m_ignoreSampleField);    textFieldControlPanel.add(m_collectSampleField);    final JPanel textFieldPanel = new JPanel(new BorderLayout());    textFieldPanel.add(textFieldLabelPanel, BorderLayout.CENTER);    textFieldPanel.add(textFieldControlPanel, BorderLayout.EAST);    setLayout(new GridLayout(0, 1));    add(intervalLabel);    add(m_intervalSlider);    add(textFieldPanel);  }