Sponsors: Michael Fertik - Best JAVA Web hosting Company & 30% off


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-02-2009, 11:03 PM
Member
 
Join Date: Nov 2009
Posts: 1
Rep Power: 0
tmoehlman is on a distinguished road
Default Display partial file contents in JTextArea
I'm looking for a way to view the contents of a file in a JTextArea in such a way that I can scroll back and forth through the file. The catch is that I only want to load a portion of the file (in the case of large files) to improve performance and avoid memory overflow.

When scrolling through the JTextArea (which presumably would be inside of a JScrollPanel), I will need some way to recognize when I've scrolled past, say 50% of, what's in the JTextArea so that I can reload it with the next chunk of the file.

The general idea is to only populate the JTextArea with a set number of characters and to dynamically retrieve chunks of the file as needed.

Any suggestions on how to approach this?
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

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

BB 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
Problem with painting the contents of a file on a JTextArea Willi AWT / Swing 12 10-09-2009 06:26 AM
problem trying to display the contents of a text file in JTextArea warship New To Java 17 07-13-2009 05:44 AM
problems trying to view the contents of a text file in JTextArea warship New To Java 1 07-18-2007 11:20 PM
problem trying to view the contents of a text file in JTextArea warship AWT / Swing 0 07-17-2007 03:30 PM
viewing the contents of a text file in JTextArea warship New To Java 0 07-17-2007 02:29 PM


Java Forums is supported by the best jsp hosting.

All times are GMT +2. The time now is 09:08 PM.



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