Results 1 to 3 of 3
  1. #1
    prasad.vara is offline Member
    Join Date
    Jul 2010
    Location
    Hyderabad
    Posts
    21
    Rep Power
    0

    Default how to place cursor at end of each line in JEditorPane

    Hi,
    I have a requirement that i want to place cursor at the end of the line,on which line i selected in JEditorPane.If each line contains 100 characters ,i just placed 50 characters.And i want to move the cursor to 100th character position of the same line.I tried with setCaretPosition but it shows BadPositionException.please help me.

    Thanks in advance,
    Prasad.

  2. #2
    Horcrux7 is offline Member
    Join Date
    Sep 2010
    Posts
    33
    Rep Power
    0

    Default

    You can all simple the endLineAction. It should work with the follow code:

    editor.getActionMap().get(DefaultEdititoKit.endLin eAction).actionPerformed(null);
    Volker Berlin
    www.inetsoftware.de

  3. #3
    prasad.vara is offline Member
    Join Date
    Jul 2010
    Location
    Hyderabad
    Posts
    21
    Rep Power
    0

Similar Threads

  1. Replies: 2
    Last Post: 07-02-2010, 02:20 PM
  2. change the mouse cursor - crosshair cursor
    By cassysumandak in forum New To Java
    Replies: 1
    Last Post: 09-28-2009, 01:57 AM
  3. JEditorPane Example
    By Java Tip in forum javax.swing
    Replies: 0
    Last Post: 06-27-2008, 07:47 PM
  4. insertHTML in a JEditorPane
    By olbion in forum New To Java
    Replies: 1
    Last Post: 05-05-2008, 12:30 PM
  5. JEditorPane
    By drmmr11 in forum Java Applets
    Replies: 0
    Last Post: 08-02-2007, 06:08 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
  •