jtp是什么

来源:百度知道 编辑:UC知道 时间:2024/06/23 02:12:32

1. If your chat room is implemented using jsp, trying following:
<% if id.equals("who") {%>
<font size="10" color="red" face="arial"><%=message%></font>
<% } %>

2. If your chat room is implemented using Applet, then you can try following codes in your Applet class:

JTextPane jtp = new JTextPane();
add(jtp);
Style def = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE);
Style regular = jtp.getStyledDocument().addStyle("regular", def);
StyleConstants.setFontFamily(def, "SansSerif");
Style s = jtp.getStyledDocument().addStyle("italic", regular);
StyleConstants.setItalic(s, true);
s = jtp.getStyledDocument().addStyle("small", regular);
StyleConstants.setFontSize(s, 10);

if ( id.equals( "who1" ) )
jtp.getStyledDocument().insertString(jtp.g