• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTextPane becomes gray sometimes  RSS feed

 
Ajay Singhal
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends
i have created a chat application. interface is designed using Swing JTextPane component.
when chat users start chatting sometimes textpane becomes gray on receiving a new message.
if anyone know, came across the kind of problem then kindly send me a reply OR send me a mail at Ajay_k_singhal@yahoo.com
Thanx
 
Roy Ben Ami
Ranch Hand
Posts: 732
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you post some code related to the writing of the message on the textpane?
[ March 08, 2002: Message edited by: Roy Ben Ami ]
 
Ajay Singhal
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
the code i have written to add chat messages to the chat panel is :
current = (AttributeSet)ht.get(BOLDBLUE);
doc.insertString(doc.getLength(),name+": ",current);
current = (AttributeSet)ht.get(NORMALBLACK);
doc.insertString(doc.getLength(),message+"\n",current);
where :
name is name of the chat user
message is chat message
BOLDBLUE is
static final String BOLDBLUE = "BoldBlue";
NORMALBLACK is
static final String BOLDBLUE = "NormalBlack";
kindly reply if you think there is some possible solution.
Thanx
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!