r = g.getClipBounds(); g.clearRect(r.x, r.y, r.width, r.height); g.setFont( f ); fm = g.getFontMetrics(); int xpos = 0, ypos = 0, attribWidth=0;  g.setColor(fontColor); xpos = extpad; ypos=extpad+fm.getHeight();  for(int i=0; i<m_selectedAttribs.length; i++) { if( xpos+cellSize < r.x) { xpos += cellSize+extpad; continue; } else if(xpos > r.x+r.width) { break; } else { attribWidth = fm.stringWidth(m_data.attribute(m_selectedAttribs[i]).name()); g.drawString(m_data.attribute(m_selectedAttribs[i]).name(), (attribWidth<cellSize) ? (xpos + (cellSize/2 - attribWidth/2)):xpos, ypos); } xpos += cellSize+extpad; } fm = null; r=null; }
r = g.getClipBounds(); g.setColor(this.getBackground()); g.fillRect(r.x, r.y, r.width, r.height); g.setFont( f ); fm = g.getFontMetrics(); int xpos = 0, ypos = 0, attribWidth=0;  g.setColor(fontColor); xpos = extpad; ypos=extpad+fm.getHeight();  for(int i=0; i<m_selectedAttribs.length; i++) { if( xpos+cellSize < r.x) { xpos += cellSize+extpad; continue; } else if(xpos > r.x+r.width) { break; } else { attribWidth = fm.stringWidth(m_data.attribute(m_selectedAttribs[i]).name()); g.drawString(m_data.attribute(m_selectedAttribs[i]).name(), (attribWidth<cellSize) ? (xpos + (cellSize/2 - attribWidth/2)):xpos, ypos); } xpos += cellSize+extpad; } fm = null; r=null; }
	      public void paint(Graphics g) {		  r = g.getClipBounds();		  g.clearRect(r.x, r.y, r.width, r.height);		  g.setFont( f );		  fm = g.getFontMetrics();		  int xpos = 0, ypos = 0, attribWidth=0;		  		  g.setColor(fontColor);		  xpos = extpad;		  ypos=extpad+fm.getHeight();		  for(int i=0; i<m_selectedAttribs.length; i++) {		      if( xpos+cellSize < r.x)			  { xpos += cellSize+extpad; continue; }		      else if(xpos > r.x+r.width)			  { break; }		      else {			  attribWidth = fm.stringWidth(m_data.attribute(m_selectedAttribs[i]).name());			  g.drawString(m_data.attribute(m_selectedAttribs[i]).name(), 				       (attribWidth<cellSize) ? (xpos + (cellSize/2 - attribWidth/2)):xpos, 				       ypos);		      }		      xpos += cellSize+extpad;		  }		  fm = null; r=null;	      }