Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2008
    Location
    Fort Wayne, Indiana
    Posts
    62
    Rep Power
    0

    Default [SOLVED] Last line in JTextArea wont display

    I have a JTextArea that is displaying decoded signals that are stored in a file. The file is updated periodically during the execution of the program. I fire periodic updates to the textarea, but every time the last line of the file is not shown. If i do a copy/paste to notepad the last line shows, or if i copy the text from the textarea to another textarea it shows up just fine. Any idea what would cause this or any kind of work around? I tried just keeping the textarea in the background and copying the contents to a new one that is visible, but the data in this textarea can get infinitely large and doubling that would be unfavorable.

    Thanks,
    Chris

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

  3. #3
    Join Date
    Apr 2008
    Location
    Fort Wayne, Indiana
    Posts
    62
    Rep Power
    0

    Default

    That is the thing that i am currently checking. We wrote the underlying document structure and there may be an error in getting the length of the file. I was just wondering if anyone has heard of this issue where it wouldn't be my boss's fault.

  4. #4
    Join Date
    Apr 2008
    Location
    Fort Wayne, Indiana
    Posts
    62
    Rep Power
    0

    Default

    Underlying structure didn't increase the document length in the statement

    If(isLast()){
    break;
    }

    All fixed.

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

  6. #6
    Join Date
    Apr 2008
    Location
    Fort Wayne, Indiana
    Posts
    62
    Rep Power
    0

    Default

    The project that i am on reads signals from a semi truck and translates the binary to hex then to english. It saves all of the signals in a text area that is backed up by a text document. These signals come across the wire at about 100 per second making this file grow very fast. We rewrote the document class so that we could cache lines and find which one is closest to the line we want then work from there. Reading an 8 gig file line by line to find one line is not very efficient. But in the function getLength() the counter was incremented for each line, but was never incremented for the last line before the break. Two and a half weeks of work to find that one in the middle of a 15 function stack trace. I'm just glad that hell is over. On to the next bug...

Similar Threads

  1. [SOLVED] Delete Current line from file
    By Azndaddy in forum New To Java
    Replies: 2
    Last Post: 04-06-2012, 08:00 AM
  2. Replies: 17
    Last Post: 07-13-2009, 05:44 AM
  3. [SOLVED] Line number: ?
    By Azndaddy in forum New To Java
    Replies: 1
    Last Post: 04-04-2008, 05:46 AM
  4. Display Line# and Column# in JSP
    By loganathan.lakshmanan in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 01-17-2008, 12:37 PM
  5. How to always show the last line in my JTextArea?
    By Ashley in forum New To Java
    Replies: 1
    Last Post: 05-26-2007, 01:01 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
  •