Trying to load a 20MB file into TextArea (JavaFX) and watching how the application completely hung, I wondered how applications like NotePad ++, UltraEdit, EmEditor, etc. deal with this. You can turn the scrollbar in them :) so how is this implemented? At least in the form of a concept, well, if you tell me how to do this in javafx) Thank you!
- The first thing that comes to mind is beat files on chunks and load them into separate chunks, with a size of 1.5 screens, as you scroll, load the chunk from the bottom and delete from the top, or vice versa. - Naumov
- But then this question: load the 4GB file into NotePad ++ and drag the scroll (not with the wheel, but grab the pointer) from top to bottom. As a result, something appears on the screen (scrolls), something that looks like real text. Is it 1.5 million screens downloaded several million times?) - Mr. Newman
- Double buffering will not be seen and that there where it is loaded, take 3-4 screens, the point is that you don’t stick 4gb into RAM by 2gb. - Naumov
- That is, there is nothing already implemented in Java? - Mr. Newman
- Is the application stuck at the moment when you start scrolling, or at the moment when the file is loaded? - Andrew Bystrov
|