How to display a large file in JTextArea

i am displaying a large file(a multi MB) in a JTextArea, it is showing java.lang.outofmemoryerror
are there any solutions for this problem or is there any better way other than JTextArea ???

thanks for replying but its all abt Tables
i am new to java
i asked how to display a large Text file in a JTextAreathanx
--santosh                                                                                                                                                                                                                                                                                                   

Similar Messages

  • How do I move large files from a Windows computer to my MacBook Pro? There are a lot of photos (tiffs

    How do I move large files from a Windows computer to my MacBook Pro? There are a lot of photos (tiffs, jpgs, some photoshopped files), iTunes library, word docs. Is there a particular type of external hard drive that can be used or am I limited to copying stuff onto z-drive and moving that way?

    If both computers are on the same network, you can share the files from the Windows host using SMB and mount the share on the Mac. Otherwise, the Mac should be able to read (not necessarily write) any storage device formatted in Windows.

  • How can I delete large files on my MacBook Pro?

    How can I delete large files on my MacBook Pro? Also my Emails wont delete, how can I delete them?

    Which email client are you using & which version?   Your emails are not appearing in the email trashcan? 

  • How to display a pdf file in jsp

    hi,
    How to display a pdf file in jsp iam having a class which will return fileinputstream of the file object. the pdf file is in server.
    regards
    Arul

    A JSP is a combo of HTML and Java, so you can't really "display" a PDF file in a JSP.
    You can provider a href link to the PDF file in your JSP.
    You can use some utility package to read the contents of the PDF, pull certain things out of it, and display that in your JSP as html
    In a servlet you can set the content type to application/pdf and write the binary data of the PDF back to the browser. Once the browser finishes reading in the data it should open the PDF.

  • How to send a large file in XI ?

    How to send a large file in XI ?

    hi,
    use a splitting mechanism to convert large files into smaller files and process them as if they where independent.
    You can use the "Recordsets Per Message" parameter in the File Adapter sender comm channel by using File Content Conversion, to create a new message for each 1000,10000,etc records in the source file...this could be a way of splitting.
    If you scenario works ok for small files, maybe you can develop another scenario that runs previous the current one, that only splits files (e.g. File-XI-File) and then puts the output smaller files in the directory that your current scenario monitors.
    Check this blog for huge file processing
    /people/alessandro.guarneri/blog/2007/02/21/sap-xi-acting-as-a-huge-file-mover
    Thanks,
    Vijaya

  • How do I delete large files

    How do I delete large files, so they don't take 12 to 16 hours to delete?

    Don't use the Secure Empty Trash option on items which don't contain sensitive data. If the Trash is always doing it, create two folders with the same name in different locations, drag the files into one, and move the other into the folder which contains the first.
    (51817)

  • How do i delete large files and pics of my mac book pro

    how do i delete large files and pics of my mac book pro

    Make sure that you do not delete any system file, or part of an application.
    Use Omnidisksweeper as a search tool   http://www.omnigroup.com/more

  • How do i move large file of pictures to an external drive

    how do i move large file of pictures to an external drive

    Just select the files and drag them to the external drive.
    Clinton

  • How to display a .txt file?

    i would like to ask if JAVA can open and display a text file by issuing a command from my application
    is it possible to do it without using a JEditorPane?
    something else too, how can i set the background for my application to be a .jpg image?
    i searched and realised there is no such method as
    setBackground(String url)

    Try this... Note you need to add adequate exception trapping and detect special cases like the file being larger than the allocatable size of a character array (in which case you can't convert the file to a string and will need to 'display' the file in sections)...
    import java.io.*;
    public class LoadFile {
      public static String fileToString(File file) throws IOException {
        char[] fileContents = new char[(int) file.length()];
        FileReader fr = new FileReader(file);
        if(fr.read(fileContents) != fileContents.length) {
          System.err.println("There was a problem reading the file contents");
          return null;
        else return new String(fileContents);
      public static void main(String[] args) throws IOException {
        if(args.length != 1) System.err.println("Usage:\n\tjava LoadFile <filename>");
        else {
          File f = new File(args[0]);
          try {
            String s = fileToString(f);
            System.out.println(s);
          } catch(IOException e) {
            System.err.println("Whoops");
    }Hope that helps...

  • How to Display the SAVE  file name dialogue in Forms 6i

    Dear All,
    Just like we use Get_file_Name to display the MS Open file dialogue..
    how do we display the SAVE file dialogue in forms..??
    whats the function name???
    regards,
    Sidhant

    hello friend,
    u can use webutill lib to open/save dialog box
    also must refer this link,
    Re: How To Call Save As Dialog?
    Regards
    Chandan

  • How to display an XMl file in a webydynpro Application.

    Hi All,
    I am working with a webdynpro application where i have an xml file. when ever i run the webdynpro application it has to display that xml file in the browser instead of view. It would be appreciable if anyone give me some idea on how to start this application
              Thanks in advance
    Regards
    ravi

    HI Ravi,
    Insert a portalIFRame or IFrame with width 100%.
    Create a context variable (Say xmlFile) of type String and bind to Source property of PoratlIFrame .
    Put the xmlfile inside Project\src\mimes\Components\Package\
    Let the xml file name be Config1.xml.
    Write the following code inside wdDoinit()
    wdContext.currentContextElement().setPortalFrame(WDURLGenerator.getWebResourceURL(wdComponentAPI.getComponent().getDeployableObjectPart(),"Config1.xml"));
    Regards
    Fahad Hamsa

  • How to display the attached file of DMS in WEB Dynpro

    Hello everybody! I have to work with DMS documents on the portal. Do You know, how display the attached files of DMS document in WEB Dynpro?
    Pavel Truhlář

    Hi Pavel,
    By using the below F.M we can display DMS Document.
    CALL FUNCTION 'CVAPI_DOC_VIEW'
      EXPORTING
        PF_DOKAR               = 'ZAP'
        PF_DOKNR               = LS_DMS_TABLE-DOKNR
        PF_DOKVR               = '00'
        PF_DOKTL               = '000'
       PF_HOSTNAME            = 'DEFAULT'
       PF_APPL_START          = ' '
       PF_GET_URL             = 'X'
    IMPORTING
       PFX_URL                 = V_URL
    EXCEPTIONS
       ERROR                  = 1
       NOT_FOUND              = 2
       NO_AUTH                = 3
       NO_ORIGINAL            = 4
       OTHERS                 = 5.
    After getting the V_URL Create External Window.
      LO_API_COMPONENT  = WD_THIS->WD_GET_API( ).
      LO_WINDOW_MANAGER = LO_API_COMPONENT->GET_WINDOW_MANAGER( ).
      LO_WINDOW         = LO_WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW(
                    URL = LW_URL ).
    BR,
    Jack.

  • How to display my text file in swing

    hi all,
    i have a screen where user enters a batch no. and number.
    when user presses a button i should get a list displayed on my sreen.
    how to do this...and how to call function that generates the list in my actionlistener..please help me....

    You need to post some code in code tags. What you are asking is very easy to do yet it sounds as though you are flustered. Step back and learn each and every thing you need to do (plan) before you attempt anything in Java, trying to find out what API you need in the middle of a project is a sign of looming disaster.
    Your button needs and actionlistener and an actionPerformed method; if you have only a foggy idea what this is you need to look them up. Also, your list can be displayed in a JTextPane, JEditorPane, JTextArea, JList (?), or JTable. I suggest all these since I did not see specific requiorments posted. When dealing with any of these pay atention to the model (contains the data FOR the view object). JTextArea is the lightest of these and probably the least confusing, be sure to put it in a JScrollPane if you want to, uh, scroll the list.
    Sean

  • How to display thumbnail of files????

    i want to display my avi file list in thumbnail view as windows explorer is providing... can anyone tell me... how can i implement the same??

    Cross post: http://forum.java.sun.com/thread.jspa?threadID=646758

  • How to display graphics larger than canvas size?

    How do I display graphics larger than canvas size in Java AWT?
    I tried setting the canvas size() to a value larger than my monitor size, and then adding scroll bars to the canvas, but the scroll bars and the canvas won't go beyond the monitor size in pixels, which is only 800, so the large graphic I try to display gets cut off at the bottom.
    How can I overcome this problem? Has anybody encounter a similar dilemma before?

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    public class AWTSizing
        public static void main(String[] args)
            LargeCanvas canvas = new LargeCanvas();
            ScrollPane scrollPane = new ScrollPane();
            scrollPane.add(canvas);
            Frame f = new Frame();
            f.addWindowListener(new WindowAdapter()
                public void windowClosing(WindowEvent e)
                    System.exit(0);
            f.add(scrollPane);
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    class LargeCanvas extends Canvas
        int w, h;
        final int PAD = 10;
        Rectangle r1, r2, r3;
        Rectangle[] rects;
        boolean firstTime;
        public LargeCanvas()
            w = 360;
            h = 360;
            firstTime = true;
        public void paint(Graphics g)
            super.paint(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            if(firstTime)
                initShapes();
            g2.setPaint(Color.red);
            g2.draw(r1);
            g2.draw(r2);
            g2.draw(r3);
        private void initShapes()
            r1 = new Rectangle(w/4, h/4, w/2, h*3/4);
            r2 = new Rectangle(w/2, h/2, w/2, h/2);
            r3 = new Rectangle(w*5/8, h/6, w*3/5, h*2/3);
            rects = new Rectangle[] { r1, r2, r3 };
            firstTime = false;
            invalidate();
            getScrollPane().validate();
        private ScrollPane getScrollPane()
            ScrollPane scrollPane = null;
            Component c = this;
            while((c = c.getParent()) != null)
                if(c instanceof ScrollPane)
                    scrollPane = (ScrollPane)c;
                    break;
            return scrollPane;
        public Dimension getPreferredSize()
            Dimension d = new Dimension(w, h);
            if(rects == null)                   // before calling initShapes
                return d;
            Rectangle r;
            for(int j = 0; j < rects.length; j++)
                r = rects[j];
                if(r.x + r.width + PAD > w)
                    d.width += r.x + r.width + PAD - w;
                if(r.y + r.height + PAD > h)
                    d.height += r.y + r.height + PAD - h;
            return d;
    }

Maybe you are looking for

  • Adding navigational attributes to a cube

    We have upgraded to BW 7.3. Previously when we added navigational attributes to a cube we need to activate the update rules from the ods but now it appears that we don't need to do that anymore. Is this the expected behavaior?  We are using the 3.5 u

  • How do I reduce image in batch process on Elements 11 or 12?

    I have about a hundred photos in high resolution that I want to reduce to (the same) small image size for a website. How can I do this several (or all) at a time, instead of individually editing each one, using my Photoshop Elements 11 or 12? I canno

  • Destination Link from PDF to another PDF not working in Browser

    I'm linking PDFs by using destination links to get to a specific page of the destination PDF, which works just fine. Now I'm displaying all PDFs in a browser. My links are now opening the destination PDF, but instead of opening on the destination pag

  • I have a podcast video that refuses to be deleted.

    I have a podcast video that refuses to be deleted. Normally, a swipe would bring up the delete function. For one video it will not allow the delete button. I am sure there is not content, only the label. How can I get rid of this annoying entry? This

  • Depreciation method

    Hi SAP gurus, Can you please tell my customizing I have to do to represent following scenario? I have a new asset bought on march, so I have posting date in March. Value of the asset is 1000 u20AC % of depreciation is 20% each year (5 year useful lif