Which is the best JComponent to load 200 MB of data in it?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amitpathak
    New Member
    • Jan 2007
    • 20

    Which is the best JComponent to load 200 MB of data in it?

    I am working on a project in which I am required to read a file and load the contents in some JComponent to show it to the users.

    I was reading the file with the help of stringbuffer/filebuffer and printing in the textpane attached to a scrollbar.
    I got heap dume(out of memory space) when a 21 mb file is being loaded.

    To avoid this I tried with JTextArea instead of JTextpane.I got sucess but failed with 60 MB of file.

    So can anybody please tell me which is the best component to use for data more than 200 MB .

    Also I am using StringBuffer to read the file, is there anything else to increase the performance?

    Waiting eagerly for you reply !
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by amitpathak
    I am working on a project in which I am required to read a file and load the contents in some JComponent to show it to the users.

    Initially I used JTextpane but when the file size become 21 MB then heap dump error started coming.

    Then I used JTextarea and I got success in priniting 21 MB but got failed when size becomes 60 MB.

    So can anybody please tell me which is the best component to use for data more than 200 MB .

    Also I am using StringBuffer to read the file, is there anything else to increase the performance
    Nobody wants to work his way through 200 MB of text. Better chop up that
    large piece of text into 'pages' and show one page at a time and allow the user
    to scroll through the pages or select them directly.

    kind regards,

    Jos

    Comment

    Working...