Results 1 to 7 of 7
  1. #1
    justbeller is offline Member
    Join Date
    Dec 2010
    Posts
    57
    Rep Power
    0

    Post Problem in JTextArea

    Hello Guys I Hope u all are fine

    i have problem in jtextarea when I using "ta.getCaretPosition();" this method its getting even series like this (0,2,4,6,8,...)
    i need normal series to set position (0,1,2,3,4,5,....)

    what can I do?

    please help me

    best regards

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,560
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by justbeller View Post
    i have problem in jtextarea when I using "ta.getCaretPosition();" this method its getting even series like this (0,2,4,6,8,...)
    i need normal series to set position (0,1,2,3,4,5,....)

    what can I do?
    Are you using your own implementation of the Document interface?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  4. #4
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,560
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by Fubarable View Post
    You've got a bug on line 42.
    Do you mean 42 in base 13, so 54 decimal (which is 66 octal), or 42 decimal, as in just 42 (52 octal)?

    kindest regards,

    Jos ;-)
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    justbeller is offline Member
    Join Date
    Dec 2010
    Posts
    57
    Rep Power
    0

    Default

    hey thanks for discussion now its working
    now here is a another problem is when im using substring method im getting StringIndexOutOfBoundsException: String index out of range: -1

    what can i do

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by justbeller View Post
    hey thanks for discussion now its working
    now here is a another problem is when im using substring method im getting StringIndexOutOfBoundsException: String index out of range: -1

    what can i do
    In case you missed it, the gist of the previous discussion is that we have no flipping idea of what's not working if you don't show us the offending code. This still holds true for today's problem. Seriously, how can we guess what you're doing wrong with the scant information that you give us?

  7. #7
    justbeller is offline Member
    Join Date
    Dec 2010
    Posts
    57
    Rep Power
    0

    Default

    Its working by using Caret Class so that why I said thanks

Similar Threads

  1. Problem with JTEXTAREA
    By javanew in forum New To Java
    Replies: 6
    Last Post: 05-07-2010, 02:14 PM
  2. JTextArea problem
    By javanew in forum AWT / Swing
    Replies: 2
    Last Post: 05-04-2010, 10:31 PM
  3. Replies: 12
    Last Post: 10-09-2009, 06:26 AM
  4. jfilechooser and jtextarea problem
    By kostinio in forum AWT / Swing
    Replies: 7
    Last Post: 10-07-2009, 08:46 AM
  5. Jtextarea Content Display Problem
    By REVANSIDDHA in forum Advanced Java
    Replies: 1
    Last Post: 03-31-2009, 06:53 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
  •