View Single Post
Old 26-02-2004, 09:38   #5
cn73
Senior Member
 
L'Avatar di cn73
 
Iscritto dal: Jul 1999
Cittā: Torino
Messaggi: 2221
Mi sono spiegato male... Anche a me funziona con del testo normale, il mio scopo č dare una formattazione HTML al messaggio... ti riporto il metodo getHtmlText() cui accennavo prima...

Codice:
public final static String HTML_TAG_START = "<html><b><font size=+0 color=black> ";
  public final static String HTML_TAG_END	 = " </font></b></html>";

....

public static String getHtmlText(String text){
   	StringBuffer sb = new StringBuffer();
   	StringTokenizer st = new StringTokenizer(text,"\n",false);
   	if (st.hasMoreTokens())
   		sb.append(st.nextToken());
   	
   	while (st.hasMoreTokens()){
   		sb.append("<br>");
   		sb.append(st.nextToken());   		
   	}	
		//System.out.println("DEBUG!! " +    	sb.toString());
   	return HTML_TAG_START + sb.toString() + AllegatiConstants.HTML_TAG_END;
   }
cn73 č offline   Rispondi citando il messaggio o parte di esso