Highlighting text in a JTextArea


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Highlighting text in a JTextArea

  1. #1
    Tom Guest

    Highlighting text in a JTextArea


    I have a text area that is populated with some data. It allows the user to
    make updates and
    save it back to the database. They would like to have all current change
    to be "highlighted"
    until the have saved. I can't use caret position and selection, because
    the edits can be in multiple
    areas of the same text field. In addition, if the text were selected, it
    would be replaced with the next
    keystroke.

    Does anyone have any suggestions?

    Thanks,
    Tom


  2. #2
    Paul Clapham Guest

    Re: Highlighting text in a JTextArea

    Well, you might want to look at the text editing classes in package
    "javax.swing.text". I haven't got to them yet but they look as if they
    could be used to do what you ask.

    Tom <mr_gibby@yahoo.com> wrote in message news:3908f847$1@news.devx.com...
    >
    > I have a text area that is populated with some data. It allows the user

    to
    > make updates and
    > save it back to the database. They would like to have all current change
    > to be "highlighted"
    > until the have saved. I can't use caret position and selection, because
    > the edits can be in multiple
    > areas of the same text field. In addition, if the text were selected, it
    > would be replaced with the next
    > keystroke.
    >
    > Does anyone have any suggestions?
    >
    > Thanks,
    > Tom
    >




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


   Development Centers

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