Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2012
    Posts
    33
    Thanks
    1
    Thanked 1 Time in 1 Post

    Show cursor where user clicks

    I have a JTextArea setup and its working fine. I just need to show the flashing cursor where ever a user clicks.
    Can anyone help me?

    Thanks

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,980
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    I'm not sure I understand what you are looking at.
    JTextArea will already move the caret to where you click, so long as there is text there. If you want to place a cursor up to that point, it could probably be done by attaching a listener to the caret or a mouse listener, and padding the space up to it with spaces. I don't think the component will allow me to force render a caret in the middle of a document without content. Could be wrong though since I've never tried that.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •