private Vector showTextFixedWidth(String text,int align){
  Vector comps=new Vector();
  if ((text == null) || (text.equals(""))) {
    return comps;
  }
  int spaceW=width - x;
  Vector words=getWords(text,align,false);
  if (words.size() > 0) {
    int w=0;
    String wordStr="";
    if ((CSSParser.isWhiteSpace(text.charAt(0))) && (curLine.getComponentCount() != 0)) {
      wordStr=" ";
    }
    while (w < words.size()) {
      String nextWord=(String)words.elementAt(w);
      String space="";
      if ((!wordStr.equals("")) && (!wordStr.equals(" "))) {
        space=" ";
      }
      if (font.stringWidth(wordStr + space + nextWord) > spaceW - 2) {
        comps.addElement(addString(wordStr,align));
        newLineIfNotEmpty(align);
        spaceW=width - x;
        wordStr=nextWord;
      }
 else {
        wordStr+=space + nextWord;
      }
      w++;
    }
    if (CSSParser.isWhiteSpace(text.charAt(text.length() - 1))) {
      wordStr+=" ";
    }
    comps.addElement(addString(wordStr,align));
  }
  return comps;
}

private Vector showTextFixedWidth ( String text , int align ) { Vector comps = new Vector ( ) ; if ( ( text == null ) || ( text . equals ( "" ) ) ) { return comps ; } int spaceW = width - x ; Vector words = getWords ( text , align , false ) ; if ( words . size ( ) > 0 ) { int w = 0 ; String wordStr = "" ; if ( ( CSSParser . isWhiteSpace ( text . charAt ( 0 ) ) ) && ( curLine . getComponentCount ( ) != 0 ) ) { wordStr = " " ; } while ( w < words . size ( ) ) { String nextWord = ( String ) words . elementAt ( w ) ; String space = "" ; if ( ( ! wordStr . equals ( "" ) ) && ( ! wordStr . equals ( " " ) ) ) { space = " " ; } if ( font . stringWidth ( wordStr + space + nextWord ) > spaceW - 2 ) { comps . addElement ( addString ( wordStr , align ) ) ; newLineIfNotEmpty ( align ) ; spaceW = width - x ; wordStr = nextWord ; } else { wordStr += space + nextWord ; } w ++ ; } if ( CSSParser . isWhiteSpace ( text . charAt ( text . length ( ) - 1 ) ) ) { wordStr += " " ; } comps . addElement ( addString ( wordStr , align ) ) ; } return comps ; }
shows the given text . this method breaks lines as necessary and adds the text either as regular labels or links .
