Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-08-2008, 02:55 PM
Chris.Brown.SPE's Avatar
Member
 
Join Date: Apr 2008
Location: State College, PA
Posts: 50
Chris.Brown.SPE is on a distinguished road
Send a message via AIM to Chris.Brown.SPE
[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
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-09-2008, 06:24 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,543
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Are you sure that not misses the last line when you extract/read data from the file?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 04-09-2008, 07:03 AM
Chris.Brown.SPE's Avatar
Member
 
Join Date: Apr 2008
Location: State College, PA
Posts: 50
Chris.Brown.SPE is on a distinguished road
Send a message via AIM to Chris.Brown.SPE
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.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 04-10-2008, 06:40 PM
Chris.Brown.SPE's Avatar
Member
 
Join Date: Apr 2008
Location: State College, PA
Posts: 50
Chris.Brown.SPE is on a distinguished road
Send a message via AIM to Chris.Brown.SPE
Underlying structure didn't increase the document length in the statement

If(isLast()){
break;
}

All fixed.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 04-11-2008, 07:13 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,543
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Did you read line-by-line of the file? If so, why don't you use readLine() method?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 04-11-2008, 02:52 PM
Chris.Brown.SPE's Avatar
Member
 
Join Date: Apr 2008
Location: State College, PA
Posts: 50
Chris.Brown.SPE is on a distinguished road
Send a message via AIM to Chris.Brown.SPE
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...
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Line number: ? Azndaddy New To Java 1 04-04-2008 06:46 AM
problem trying to display the contents of a text file in JTextArea warship New To Java 1 04-01-2008 03:07 AM
[SOLVED] Delete Current line from file Azndaddy New To Java 1 03-28-2008 01:37 PM
Display Line# and Column# in JSP loganathan.lakshmanan JavaServer Pages (JSP) and JSTL 3 01-17-2008 01:37 PM
How to always show the last line in my JTextArea? Ashley New To Java 1 05-26-2007 02:01 PM


All times are GMT +3. The time now is 01:34 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org