public void paintIcon(Component c,Graphics g,int x,int y){
  Graphics2D g2D=(Graphics2D)g;
  Icon icon=MTreeNode.getIcon(m_type);
  if (icon != null) {
    int xI=x + ((WIDTH - icon.getIconWidth()) / 2);
    int yI=y + ((HEIGHT - icon.getIconHeight()) / 2);
    icon.paintIcon(c,g,xI,yI);
  }
 else {
    int size=10;
    int xI=x + ((WIDTH - size) / 2);
    int yI=y + ((HEIGHT - size) / 2);
    g2D.setColor(Color.magenta);
    g2D.fillOval(xI,yI,size,size);
  }
}

public void paintIcon ( Component c , Graphics g , int x , int y ) { Graphics2D g2D = ( Graphics2D ) g ; Icon icon = MTreeNode . getIcon ( m_type ) ; if ( icon != null ) { int xI = x + ( ( WIDTH - icon . getIconWidth ( ) ) / 2 ) ; int yI = y + ( ( HEIGHT - icon . getIconHeight ( ) ) / 2 ) ; icon . paintIcon ( c , g , xI , yI ) ; } else { int size = 10 ; int xI = x + ( ( WIDTH - size ) / 2 ) ; int yI = y + ( ( HEIGHT - size ) / 2 ) ; g2D . setColor ( Color . magenta ) ; g2D . fillOval ( xI , yI , size , size ) ; } }
draw the icon at the specified location . icon implementations may use the component argument to get properties useful for painting , e . g . the foreground or background color .
