DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2006

    2 JTextArea questions

    I have two questions about a JTextArea in my code

    1. Colouring, I would like to colour certain words, e.g apple should be green, pear should be green and bold etc..

    2. I want to add line numbers to each line, at the moment the number of lines is listed on the bottom, but I'd like there to be a number next to each line.

    It was created like this:
    static JTextComponent textbox = new JTextArea("", 23, 60);

    so, if anyone has any ideas I'll be very grateful!

  2. #2
    Join Date
    Dec 2004
    San Bernardino County, California
    You want to work in HTML in your JTextArea to get the text effects, and you hard code a line number for each new line of text ...

Similar Threads

  1. 400 + Java Interview Questions
    By pravin007 in forum Java
    Replies: 4
    Last Post: 05-07-2013, 04:48 AM
  2. Replies: 0
    Last Post: 12-16-2006, 02:04 AM
  3. New to JLabel and JTextArea...
    By Fay_dL in forum Java
    Replies: 1
    Last Post: 07-16-2006, 08:25 PM
  4. randomly select quiz questions
    By galgal5814 in forum ASP.NET
    Replies: 5
    Last Post: 03-10-2006, 11:10 AM
  5. Replies: 13
    Last Post: 05-23-2005, 05:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.