I’m trying to improve an existing implementation of document displaying component. One of the concerns expressed, that when loading a large bulk of text we will get an OOM exception.
From my previous experience with .net I do know that some base component implement paging, hence no all the text is visual loaded into the document hence things not only work faster but we will also, hopefully, avoid an OOM exception.
So I was wondering are there any base swing components, specifically JTextPanel, which support these capabilities?
Thank you for your help it is greatly appreciated
No, The
JTextPanedoes not support memory pages. You can create aDocuemntinstance and read the file content into theDocumentwithout installing theDocumentin theJTextPane.Then get desired fragment of the
Documentand insert it into another one showing the desired fragment only.