Results 1 to 2 of 2
  1. #1
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    9

    Default How to know the exact word on which the mouse is, in a JTextArea

    In a textarea, suppose a mouse is clicked at a certain place. How to find on which word was the mouse clicked. Is there any support in Java to do this?

  2. #2
    levent Guest

    Default

    You can add a CaretListener to your JTextArea. Then you can use methods of String class to detect start and end of the word on which the mouse is.

Similar Threads

  1. Replies: 2
    Last Post: 03-25-2008, 06:49 AM
  2. Replies: 13
    Last Post: 01-09-2008, 07:51 AM
  3. Word Scramble
    By lk9865 in forum New To Java
    Replies: 5
    Last Post: 11-17-2007, 03:22 AM
  4. Help with a word, if it is divided by spaces
    By baltimore in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 07:31 AM
  5. How to update Existing Word Doc Using java
    By umashankar in forum Advanced Java
    Replies: 1
    Last Post: 07-27-2007, 02:29 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
  •