Meaningless Drivel is fun!*
The moose likes Swing / AWT / SWT and the fly likes is it possible to make some words of jtextarea as bold? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "is it possible to make some words of jtextarea as bold?" Watch "is it possible to make some words of jtextarea as bold?" New topic
Author

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

sudheer kiran
Ranch Hand

Joined: Jun 26, 2008
Posts: 237

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,

Sudheer
SCWCD, SCJP 5
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19696
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
sudheer kiran
Ranch Hand

Joined: Jun 26, 2008
Posts: 237

thanks prime thats very useful info.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: is it possible to make some words of jtextarea as bold?