wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Bold font using FileWriter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Bold font using FileWriter" Watch "Bold font using FileWriter" New topic
Author

Bold font using FileWriter

Srinivasa Maddi
Ranch Hand

Joined: Apr 18, 2007
Posts: 60
Hi
The following will add an attribute Emp Name to myfile in a normal font style. But i want this to be added in BOLD font. How to achieve this


[ November 12, 2008: Message edited by: Srinivasa Maddi ]
Satish Chilukuri
Ranch Hand

Joined: Jun 23, 2005
Posts: 266
Plain text files by themselves do not contain any font information. You need to add extra information for that. Decide upon a file format which supports fonts like rtf, html, odf, pdf etc... and use that for your file.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42375
    
  64
What file format is this? Plain text files do not have a concept of styling text in any way.

Also, what do you mean by "attribute"? Would this be text in the file contents, or something else (like document attributes)?

Just to state the obvious, you're aware that "add" is not a method in FileWriter, right?
[ November 12, 2008: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
Srinivasa Maddi
Ranch Hand

Joined: Apr 18, 2007
Posts: 60
Its a CSV format file. Here attribute i mean a "Column Label Name" which is getting retrieved from the database.
[ November 12, 2008: Message edited by: Srinivasa Maddi ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42375
    
  64
CSV does not support text styling. If you want something that opens in Excel and which supports text styling, you can use the Apache POI library to create XLS files.
Srinivasa Maddi
Ranch Hand

Joined: Apr 18, 2007
Posts: 60
Thank You Ulf.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Bold font using FileWriter