public static void formatTooltips(Container container){
  for (int i=0; i < container.getComponentCount(); i++) {
    Component component=container.getComponent(i);
    if (component instanceof JComponent)     formatTooltip((JComponent)component);
    if (component instanceof Container)     formatTooltips((Container)component);
  }
}

public static void formatTooltips ( Container container ) { for ( int i = 0 ; i < container . getComponentCount ( ) ; i ++ ) { Component component = container . getComponent ( i ) ; if ( component instanceof JComponent ) formatTooltip ( ( JComponent ) component ) ; if ( component instanceof Container ) formatTooltips ( ( Container ) component ) ; } }
changes the tooltip text of each component in the container to be multiline html . modifies all descendants ( children , grandchildren , etc . ) .
