Results 1 to 5 of 5
Like Tree1Likes
  • 1 Post By camickr

Thread: First and Last row number from viewable portion of jtextarea

  1. #1
    shivam0101 is offline Member
    Join Date
    Mar 2010
    Posts
    28
    Rep Power
    0

    Default First and Last row number from viewable portion of jtextarea

    HI,

    I am trying to get the row numbers of first and last from viewable portion of jtextarea. The starting row is working correctly, but i am not getting the last row number.

    [Java] //editor is jtextarea Rectangle r = editor.getVisibleRect(); Point top = new - Pastebin.com

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,005
    Blog Entries
    7
    Rep Power
    20

    Default Re: First and Last row number from viewable portion of jtextarea

    The JTextArea inherits the viewToModel method; you can take it from there ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: First and Last row number from viewable portion of jtextarea

    Please use correct case/capitalization when referring to JDK classes so that we know whether you are indeed referring to JTextArea or some badly named class of your own named jtextarea.

    Also, to get better help sooner, post a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem. Most members here won't click a link, and for some of those who might, many free hosting sites are blocked by a corporate firewall.

    Moving to AWT/Swing

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,226
    Rep Power
    6

    Default Re: First and Last row number from viewable portion of jtextarea

    DarrylBurke likes this.

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: First and Last row number from viewable portion of jtextarea

    Thanks for the heads up. No use wasting time here, then.

    db

    edit Another cross post
    First and Last Row numbers from viewable portion of jtextarea? (Java in General forum at JavaRanch)
    Last edited by DarrylBurke; 02-10-2012 at 12:34 AM.
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Making a portion of JTextArea uneditable
    By nik_meback in forum AWT / Swing
    Replies: 1
    Last Post: 12-15-2010, 01:38 PM
  2. Limit number of cols in JTextArea (again)
    By berkeleybross in forum AWT / Swing
    Replies: 6
    Last Post: 07-22-2010, 09:55 PM
  3. Downloaded images aren't viewable
    By pietertje in forum New To Java
    Replies: 12
    Last Post: 07-05-2010, 02:56 PM
  4. Limit number of cols in JTextArea
    By berkeleybross in forum AWT / Swing
    Replies: 6
    Last Post: 06-27-2010, 03:20 PM
  5. Replies: 0
    Last Post: 05-07-2010, 07:27 AM

Tags for this Thread

Posting Permissions

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