Results 1 to 3 of 3
  1. #1
    gundyguyz is offline Member
    Join Date
    Jul 2009
    Rep Power

    Default How to make text bold using java

    I have a string and i want to write it in a text file ..but bold.. hw can i make the string bold or underline??:confused:

  2. #2
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Rep Power


    raw .txt files do not support bold. So there is no easy way to do it. .rtf (rich text files) do support it, but you must write .rtf xml commands out to a file.

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Colombo, Sri Lanka
    Blog Entries
    Rep Power


    Text files used plain text, you cannot format them. Some of the people confused on this. Open a text file write some text on it and save. Then click on Format->Font, and make text to Bold. Without click save close the text file. System didn't ask to save. But wordpad, MSDoc will do. Text(or plain text) not care of formatting. RTF is the solution for in such cases.

Similar Threads

  1. How to make a text field to accept numbers only?
    By Robert_85 in forum Advanced Java
    Replies: 15
    Last Post: 04-07-2009, 02:30 PM
  2. TODO in bold font in Text Editor
    By SSG_JJV in forum Eclipse
    Replies: 1
    Last Post: 03-25-2009, 11:42 PM
  3. Bold Italic function in Swing
    By Java.child in forum AWT / Swing
    Replies: 2
    Last Post: 02-19-2009, 04:08 PM
  4. String Bold
    By Xystus777 in forum New To Java
    Replies: 4
    Last Post: 01-20-2009, 07:59 AM
  5. Make a text in Jlabel down to next Line
    By hungleon88 in forum AWT / Swing
    Replies: 2
    Last Post: 12-02-2008, 12:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts