• Post Reply Bookmark Topic Watch Topic
  • New Topic

How do i Underline text in a JTextfield  RSS feed

 
Gary Singleton
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried using
map attrs = new HashMap();
attrs.put(TextAttribute.UNDERLINE,TextAttribute.UNDERLINE_ON);
setFont(new Font(attrs));
but it doesn't show the underline?
Any suggestions
Thanks
 
Vikalp Setya
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you use a JTextPane instead of JTextArea and set te style of text to underline.
You may refer to Grahic Java Volumen II book for setting styles.
Regards,
vikalp_setya@rediffmail.com
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!