Results 1 to 1 of 1
- 11-03-2009, 12:03 AM #1Member
- Join Date
- Nov 2009
- Rep Power
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?
- By Willi in forum AWT / SwingReplies: 12Last Post: 10-09-2009, 07:26 AM
- By warship in forum New To JavaReplies: 17Last Post: 07-13-2009, 06:44 AM
- By warship in forum New To JavaReplies: 1Last Post: 07-19-2007, 12:20 AM
- By warship in forum AWT / SwingReplies: 0Last Post: 07-17-2007, 04:30 PM
- By warship in forum New To JavaReplies: 0Last Post: 07-17-2007, 03:29 PM