public void drawString(final Graphics g,final JComponent c,final String text,final int underlinedChar,final int x,final int y,final boolean isEnabled,final boolean isSelected){
  char lc, uc;
  int index=-1, lci, uci;
  if (underlinedChar != '\0') {
    uc=Character.toUpperCase((char)underlinedChar);
    lc=Character.toLowerCase((char)underlinedChar);
    uci=text.indexOf(uc);
    lci=text.indexOf(lc);
    if (uci == -1)     index=lci;
 else     if (lci == -1)     index=uci;
 else     index=(lci < uci) ? lci : uci;
  }
  SwingUtilities2.drawStringUnderlineCharAt(c,g,text,index,x,y);
}

public void drawString ( final Graphics g , final JComponent c , final String text , final int underlinedChar , final int x , final int y , final boolean isEnabled , final boolean isSelected ) { char lc , uc ; int index = - 1 , lci , uci ; if ( underlinedChar != '\0' ) { uc = Character . toUpperCase ( ( char ) underlinedChar ) ; lc = Character . toLowerCase ( ( char ) underlinedChar ) ; uci = text . indexOf ( uc ) ; lci = text . indexOf ( lc ) ; if ( uci == - 1 ) index = lci ; else if ( lci == - 1 ) index = uci ; else index = ( lci < uci ) ? lci : uci ; } SwingUtilities2 . drawStringUnderlineCharAt ( c , g , text , index , x , y ) ; }
draw a string with the graphics g at location ( x , y ) just like g . drawstring ( ) would . the first occurrence of underlinechar in text will be underlined . the matching is not case sensitive .
