DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2006
    Posts
    1

    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!
    Alex

  2. #2
    Join Date
    Dec 2004
    Location
    San Bernardino County, California
    Posts
    1,468
    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

Bookmarks

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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links