• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is it possible to make some words of jtextarea as bold?

 
sudheer kiran
Ranch Hand
Posts: 237
Firefox Browser MyEclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i have a requirement where i need to put first word of the JTextArea in bold font.
i need to use only JTextArea as this is a table column header.any suggestions please.



thanks,
 
Rob Spoor
Sheriff
Pie
Posts: 20661
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Switch to JTextPane instead. JTextArea only knows plain text. It takes a Document as its model. JTextPane take a StyledDocument which can be used to add style information like bold etc.

There are some drawbacks however. JTextPane misses some features JTextArea does have, like word wrapping.
 
sudheer kiran
Ranch Hand
Posts: 237
Firefox Browser MyEclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks prime thats very useful info.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic