Hello and welcome to our community! Is this your first visit?
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
    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?


  2. #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Saskatoon, Saskatchewan
    Thanked 2,668 Times in 2,637 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'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


Posting Permissions

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