Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Change of color for selected text in AWT

  1. #1
    Junior Member
    Join Date
    Mar 2010
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Change of color for selected text in AWT

    Hi All,

    I have developed a tool using AWT components and i use the textarea and list control to populate data records in the list control. My problem is , if there is an error record, i would want to the record color to change into red and the remaining unerrored records in different color.

    Iam unable to do this as it allows only one color in the control to change for all the records.

    I have tried to subclass the color base class and tried to create a new sub-class contructor overiiding the tostring method and passing the argument in the subclass contructor with the color returned.

    Can any one can help me to fix this. I cannot go with swing components as my application is completed and use AWT

    thanks,


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Change of color for selected text in AWT


  3. #3
    Junior Member
    Join Date
    Mar 2010
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Change of color for selected text in AWT

    Hi, Iam actually looking to change the color of text either for textarea or list control ( AWT). should be able to display color of errored text in red and remaining text in black at the same time.

    If my AWT application can be extended with jtextarea air jlist will try using the same

Similar Threads

  1. How to Change JTextArea font, font size and color
    By Flash in forum Java Swing Tutorials
    Replies: 7
    Last Post: January 14th, 2012, 10:47 PM
  2. java program to copy a text file to onother text file
    By francoc in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: April 23rd, 2010, 03:10 PM
  3. Checkbox - Change Font Color
    By wakebrdr77 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 10th, 2010, 10:57 AM
  4. how to delete record based on checkbox selected checkbox
    By -_- in forum JavaServer Pages: JSP & JSTL
    Replies: 0
    Last Post: December 15th, 2009, 09:26 PM
  5. How prograssbarColor with differentThe color indicates
    By NARs in forum AWT / Java Swing
    Replies: 0
    Last Post: October 18th, 2009, 10:04 PM