int w = getWidth();
int w = this.getWidth();
    protected void paintNumeric(Graphics gx) {      setFonts(gx);      int w = getWidth();      double rs = 15;      double incr = 240.0 / (double)(w-(m_HorizontalPad*2));      int hf = m_labelMetrics.getAscent();            for (int i=m_HorizontalPad;i<	     (w-m_HorizontalPad);i++) {	Color c = new Color((int)rs,150,(int)(255-rs));	gx.setColor(c);	gx.drawLine(i,0,		    i,0+m_spectrumHeight);	rs += incr;	}      	int fieldWidthC = (int)((Math.log(m_maxC)/Math.log(10)))+1;		String maxStringC = Utils.doubleToString(m_maxC,						 fieldWidthC+1+m_precisionC,						 m_precisionC);		int mswc = m_labelMetrics.stringWidth(maxStringC);	int tmsc = mswc;	if (w > (2 * tmsc)) {	  gx.setColor(Color.black);	  gx.drawLine(m_HorizontalPad,		      (m_spectrumHeight+5),		      w-m_HorizontalPad,		      (m_spectrumHeight+5));	  gx.drawLine(w-m_HorizontalPad,		      (m_spectrumHeight+5),		      w-m_HorizontalPad,		      (m_spectrumHeight+5+m_tickSize));	  gx.drawString(maxStringC, 			(w-m_HorizontalPad)-(mswc/2),			(m_spectrumHeight+5+m_tickSize+hf));	  gx.drawLine(m_HorizontalPad,		      (m_spectrumHeight+5),		      m_HorizontalPad,		      (m_spectrumHeight+5+m_tickSize));	  fieldWidthC = (int)((Math.log(m_minC)/Math.log(10)))+1;	  maxStringC = Utils.doubleToString(m_minC,					    fieldWidthC+1+m_precisionC,					    m_precisionC);	  mswc = m_labelMetrics.stringWidth(maxStringC);	  gx.drawString(maxStringC, 			m_HorizontalPad-(mswc/2),			(m_spectrumHeight+5+m_tickSize+hf));	  // draw the middle value if there is space	  if (w > (3 * tmsc)) {	    double mid = m_minC+((m_maxC-m_minC)/2.0);	    gx.drawLine(m_HorizontalPad+((w-(2*m_HorizontalPad))/2),			(m_spectrumHeight+5),			m_HorizontalPad+((w-(2*m_HorizontalPad))/2),			(m_spectrumHeight+5+m_tickSize));	    fieldWidthC = (int)((Math.log(mid)/Math.log(10)))+1;	    maxStringC = Utils.doubleToString(mid,					      fieldWidthC+1+m_precisionC,					      m_precisionC);	    mswc = m_labelMetrics.stringWidth(maxStringC);	    gx.drawString(maxStringC,			  m_HorizontalPad+((w-(2*m_HorizontalPad))/2)-(mswc/2),			  (m_spectrumHeight+5+m_tickSize+hf));	  }	}    }