CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2000
    Posts
    22

    setting colors to font

    how to set color to a particular font in'
    the text area?
    help


  2. #2
    Join Date
    May 1999
    Location
    Pune, MH, India.
    Posts
    453

    Re: setting colors to font

    I didn't understand your question exactly.

    If you want to have color for whole text in text area depending on what font is set, you can create sub-class of text area and have a hashtable there which will relate fontnames and collors. And in 'setFont' method you can set appropriate color.

    If you want text in text area with different colors, java has provided info in JDK1.3 documentation. See javax.swing.JTextComponent. There you will find 'General rules...' link which will take you to java's page for showing multi-colored (styled) text.
    Using java.awt.TextArea you cant do such a thing... at least I don't know about it.

    - UnicMan
    http://members.tripod.com/unicman

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured