Pasting big text in text area

Hello everybody,
I have a simple program:
import javax.swing.*;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class TextPane extends JFrame {
JButton b = new JButton("Add Text");
JEditorPane tp = new JEditorPane();
public void init() {
Container cp = getContentPane();
tp.setSize(200,200);
cp.add(new JScrollPane(tp);
public static void main(String[] args) {
TextPane frame = new TextPane();
frame.init();
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
frame.setSize(500,500);
frame.setVisible(true);
I start it with -Xmx48m and if I try to paste 5mb text in the JEditorPane I have OutOfMemory. With 64MB I succeed to paste it, but Task manager shows that the program is using 80 MB of memory (before the paste it uses 13MB)! If I want to paste 10MB I need to start the program with 128MB heap and if I paste it consumes 150MB memory (again 13MB before this)! I have the same results with JTextArea and JTextPane.
Why these text components need so much memory to handle big text areas and is there a way to avoid this?

What's going on here, nobody can answer this....
I tried with 3 different SUN JDK versions, I tried with IBM JDK, the results are the same. It seems that it's not a problem of the JDK, but a problem of the language itself. If you want to work in your text editor with more than 1 MB text don't use JAVA.... Or use a machine with 4-5 GB RAM at least....

Similar Messages

  • I have an iPhone 4 and want to be able to send photos via ams. I hold down the copy button on the picture but when I go to paste it in the text of a message it won't paste. Any ideas on this please.Thanks

    I have an iPhone 4 and want to be able to send photos via sms. I hold down the copy button on the picture but when I go to paste it in the text of a message it won't paste. Any ideas on this please??Thanks

    No phone can send photos via SMS. You would need MMS (or iMessage or a 3rd party app such as WhatsApp). SMS messages are limited to 160 characters of text only.

  • Problem while copying Text from Jtext Area ..

    I am trying to copy text from a JtextArea onto any Text Editor .. What happens is that the pasted text in the Text Editor eg : TextPad, JCreator etc .. has extra Carriage Return appended at the end of everyline (line separator to be exact).
    Eg :- Actual Text on Text Area :
    Executing PU for PMGS.................
    Completed PMGS PU successfully.
    - When Pasted on a Text Editor Blank Document becomes :
    Executing PU for PMGS.................
    Completed PMGS PU successfully.
    I am not being able to understand how this extra CR (Carriage Return gets added .. Looking for an urgent solution to this problem ,,

    rathor5 wrote:
    When I am copying a song from my pc to lumia 620 . It automatically create 3 or 4 links of that song in "music+video" hub . I have already refreshed my phone but the problem is still persists.
    Do you already have the amber update on your Lumia? Pre-amber solution for that is to perform a complete hard reset of the device - so make it sure to do a backup first.
    Good luck

  • Automatically create new slide after pasting large block of text?

    Hello,
    Does anyone know if it is possible to have Keynote automatically create new slides if I paste text that doesn't fit into a single slide? The biggest time waster I've encountered is the apparent requirement to break up large chunks of text manually.
    If Keynote does not do this, any ideas as to an Applescript or something that could help?
    Much appreciated

    I usually try dragging from the bottom up in Web pages, it can be tricky getting at the part you want without the extraneous formatting, since that is concealed from you and web designers use many different methods for layout.
    That's why pasting into a plain text document is a good idea to shake off the web formatting, otherwise you are groping around whatever Pages has interpreted the formatting to mean. Even browsers don't get this all right.
    If the original was formatted as a table which won't fit one of the cells on a Pages page, it just pops and won't continue because Pages does not allow breaks in mid cell. If the cells are small enough to fit and you have pasted the table inline in the main text body of a WP file (between the margins) it will flow.
    Peter

  • Pasting large blocks of text (books) into Adobe InDesign?

    I'm trying to take a books that's in PDF format and copy the text and then paste it into Adobe InDesign so I can then turn it into an EPUB file. Anyways I don't know how to do this because the text only pastes onto one page at a time.
    How do I go about doing this?
    Thanks

    That's a horrible way to do it. Nevertheless, if that's your workflow:
    The problem does not lie in InDesign. You can select, copy, and then paste many pages of text at once in InDesign. I think it might be because you cannot select-and-then-copy multiple pages in your PDF viewer. Ask in the Acrobat forum about that. (Uh, that is, if you are using Acrobat. If you have some other PDF viewer software, find a forum for that.)

  • Big and small text alignment

    Why doesn't InDesign align text to the border of the textframe?
    Especially with big and small text in the same textframe, the gaps before the text are scaled too making text optically not aligned at all.
    Optical margin alignment helps a bit, but not good enough.
    Am i overlooking something?
    Still working in CS3 btw.

    Ok knowing the right term "side bearing", i did some google searching and stumbled upon this topic at indesignsecrets:
    http://indesignsecrets.com/removing-space-along-left-edge.php
    There's a link to a script from Dave Saunders that aligns the letters optically to the left. Tested and works! InDesigns own optical margin alignment should be turned of though. I immediately assigned a shortcut to this great script.
    PS: Concerning the "why is side bearing split into left and right": i guess for example a letter 'D' for example shouldn't have equal side bearings because of the rounding to right.

  • After install Windows 10, the texts in Skype are not very neat, with low definition

    After  install Windows 10, the texts in Skype are not very neat, with low definition. This has happend just with Skype. Do you know how I can fix it?

    I HAVE FOUND A FIX! Searching through the support blogs paid off in a big way. A minor registry edit is all it took and my drive is working like new! Here's the fix. My system is Windows 10 64-bit.  Resolution 5: Create a registry subkey
    Note To use this method, you must be logged on to Windows as an administrator. If you need help verifying that you are an administrator, go tohttp://support.microsoft.com/gp/admin
    Important Follow the steps in this section carefully. Serious problems might occur if you modify the registry incorrectly. Before you modify it, back up the registry for restoration in case problems occur.
    To create the registry subkey, follow these steps:
        Press the Windows logo key + R to open the Run box. (or right-click on windows icon in lower left corner)
        Type regedit in the Run box, then press Enter. If you are prompted for an administrator password or for a confirmation, type the password, or click Allow
        In the navigation pane, locate the following registry subkey:
        HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\atapi
        Right-click atapi, point to New, then click Key.
        Type Controller0, and then press Enter.
        Right-click Controller0, point to New, and then click DWORD(32-bit) Value .
        Type EnumDevice1, and then press Enter.
        Right-click EnumDevice1, click Modify....
        Type 1 in the Value data box, and then click OK.
        Exit Registry Editor.

  • Text messages ringtones are not working in the Storm Two

    Device:  Storm Two running OS version 5.0.0.713 on the Verizon Wireless network.
    Recently, I upgraded from a Storm One to a Storm Two because of a multitude of issues with the Storm One; not enough memory, constant lock-ups; dropped calls, etc.  On the Storm One I had customer ringtones for contacts; so when a contact calls me the phone will sound a specific ringtone for that contact; the same for text messages from that contact. Now that I have the Storm Two the text message tones for the contacts are not working. In fact, even when I select a ringtone for text messages for a contact the phone will ring the generic ringtone that comes with the phone. If I go into the sound profile and change the generic ringtone to one of my own and the contact sends me a text/sms message the phone will ring the ringtone that I selected in the profile that is being used at the time. This is not the way it worked on the Storm One.  On the Storm One; if I have a specific ringtone for the contact and that contact sends me a text message it will sound the text messages tone for that contact. These ringtones have worked for previous devices including my Treo and Palm devices. The ringtone files worked well in the previous Storm One.
    So to make a long story short; I want to know why my text message ringtones are not working as designed/setup-up. If a contact calls me the phone will sound the ringtone for that contact; but if that same contact text me it will not ring the ringtone for the contact. This is annoying and I am at my wits end trying to find out why this is not working.
    Vernon

    Hi Jain....
    Field separator is for separating the fields.That means it will effect every field in the node.
    But end separator is not like that.It will apply at the end ofall fields of a node.It will effect node not a field.
    according to ur scenario if u use data.endseparator 'nl',output will come like this
    2008/0701$101
    2008/0701$102
    2008/0701$103
    2008/0702$105
    if u want new line for every field try to insert a separate node for second field.That means
    MT_DATATYPE:
    Data -
    1:UnBounded
    . .OrderDate----
    1:1
       <Data2>                   1:1
    . ....OrderNo -
    1:1
    now give data.endseparator  'nl'
                data2.endseparator 'nl'
    if possible try like this....
    Sreedhar Goud L

  • On iphone 4 how do i block text messages that are coming from an email account?

    on iphone 4 how do i block text messages that are coming from an email account?

    There is no way to block text messages.  You may wish to report them to your carrier

  • Both my husband and I have both downloaded the new IOS 8.2 and now he is getting my text messages that are only addressed to me  He is a 5 and I have a 6.  How can I fix that?

    My husband and I have both downloaded the new IOS 8.2 and now he is getting my text messages that are only addressed to me.  He has a 5 and I have a 6. It is like we are synced together.  How can I fix that?

    Is he getting your SMS messages (green) or your iMessages (blue). If SMS message, go to Settings>Messages and turn off Text Forwarding. If blue, are you sharing an Apple ID? You should each have your own.

  • Not able to make change of text in text symbol which are stored in txt pool

    Hi Experts,
    I have new problem today. I have been told to make changes of header text which is displayed after running one customized program.
    Program name : ZSDXXXXX1 which is attached in one Tcode: ZSDXX2.But when I goto SE38 and display the program to make changes, it shows the following different report name like AQCSSYSTQV000009ZSDXXXXX1 and the text symbols text-f58 which are somewhat different.
    Pls gide me to proceed further...
    In SE38:
    report AQCSSYSTQV000009ZSDXXXXX1
       line-size 253 no standard page heading line-count 000(003).
    include <symbol>.
    include <icon>.
    selection-screen: begin of block prog
                               with frame title text-f58.
    tables LIKP.
    data %count-LIKP(4) type x.
    data %linr-LIKP(2).
    tables aqldb.
    include rsaqexcd.
    data: begin of %st_liste occurs 100,
              head(1),
              tab(3),
              line(6) type n,
              cont(1) type n,
              fint(1),
              finv(1),
              fcol(1) type n,
              text(0253),
          end of %st_liste.
    etc.

    As per the report name "AQCSSYSTQV000009ZSDXXXXX1", it seems that there will be a SAP Infoset "ZSDXXXXX1"
    Go to transaction SQ02 with this infoset name "ZSDXXXXX1" then press change button.
    Then on right hand side there witll be field groups/data fields. Select the folder corresponding to Text-F58 and then press change button .
    If it does not work try transaction SQ01 & SQ03.
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Apr 11, 2008 4:29 PM

  • Different color text in text area???????

    hi,
    i am working on applet in which i want to show different color text in text area????????
    could any one help me

    I'm not sure it replies, we have developed an
    editorkit for the JEditorPane for colorizing a
    text with a property file describing a grammar. We
    provide in the packaging a trivial sample
    for coloring a java syntax in an applet.
    http://www.japisoft.com/syntaxcolor
    And of course it also requires that you buy it, and a.brillant forgot to mention that a.brillant has a financial interest in this product.

  • IS there a way to fix the issue with text list boxes where they shift (empty space is smaller than the text size) when two text lsit boxes are side by side?

    Currently I have a webpage I designed for a company where I have multiple text list boxes side by side for the purpose of displaying data in each one based on a category in the database. So a text list box for the primary key, name, serial number, etc. I have to use Firefox as it typically works best for printing and functionality for the page. The single issue we are having is that in Firefox if the field is null as far as text the text are shrinks meaning all the data in that list box shifts up and is no longer in line with its congruent data in the other text list boxes. In other browsers that's not a problem and everything stays lined up regardless of whether there's text in the box or not.
    Unfortunately I cannot provide a link but if contacted I will provide screen shots.

    Try posting at the Web Development / Standards Evangelism forum at MozillaZine. The helpers over there are more knowledgeable about web page development issues with Firefox. <br />
    http://forums.mozillazine.org/viewforum.php?f=25 <br />
    You'll need to register and login to be able to post in that forum.

  • E book" it tells me that the bI have prepared a photobook, made a pdf and when I press "buy the book is missing photos on one ore more pages. The book does not miss any photos or text, all layouts are ok, the background color is ok. Can anybody help me?

    I have prepared a photo book, made a pdf and when I press "buy thhe book" it tells me that the book is missing photos on one ore more pages. The book does not miss any photos or text, all layouts are ok, the background color is ok. Can anybody help me?

    You are missing one or more photos - youprobably have a page background that requires a photo which is behind a page with photos on it - all pages must either have a photo or be a color - if you have a gray background it requires a photo - look through the book carefully and be sure to look at the background on any full page photos - you will find one or more missing photos
    LN

  • HowDoI copy a phone number from a contact and paste it into a text

    Z10 HowDoI copy a phone number from a contact and paste it into a text message?
    Help Please. It should be so simple but in the maze of approaches to contacts from the phone or home screen which ever way you get there; how do I select a phone number, copy it and paste it into a text message to another contact so that I can send it on?
    The logic of the interface is totally baffling to me most of the time. Can't there just be one contacts interface so that when you enter it from anywhere it presents the same options to edit etc. Cannot the three blobs be called up to allow a proper edit menu - copy/cut/paste/delete.
    Can the favourites be held permanently in screen at the top with the rest of the contacts scrolling below them?
    Can it be set up so that contact pictures do not show to save screen space?
    Any help on any of these - much appreciated.
    Solved!
    Go to Solution.

    Hey jbee,
    Welcome to the BlackBerry® Support Community Forums.
    How Do I copy a phone number from a contact and paste it into a text message?
    The only option would be to to select the edit option on the contact and hold your finger on the number and select the copy option on the left side panel.
    Can the favorites be held permanently in screen at the top with the rest of the contacts scrolling below them?
    This feature is currently not available. 
    Can it be set up so that contact pictures do not show to save screen space?
    This feature is currently not available.
    Let me know if you have any other questions.
    Thanks.
    -HB
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

  • How to change area text in the area pages of ESS

    Hi ,
    i need to change the text of the areas(like employee search,personnel information..etc) in ESS.
    i am working on EP6.0& ECC 5.0.
    Can anyone help me..
    Thanks,.
    Karthik

    Hi karthik
    SPRO->IMG->cross-application components->Homepage framework ->Areas -> Define Areas ->Double click on Define Areas (Add Entries)
    double click on area which u want to add information
    EMPLOYEE_PERSINFO-> double click on it
    under Area Description (summary)
    u can change text from
    Manage your addresses, bank information, and information about family members and dependents.
    to
    Here you can change the address and personnel
    information of the employee.
    regards,
    kaushal

Maybe you are looking for

  • CS4 Acrobat 9 Pro invalid serial number

    I have Adobe Creative Suite 4 Master Collection Student Version. I bought it back in 2009. I recently uninstalled everything except Acrobat 9 Pro because I wanted to keep it. I opened Acrobat today and it asked me for a serial number. I typed in the

  • BPM Abstract Interface for IDOC?

    Hi all, I am doing an IDOC XI File scenario with BPM. I have created an Inbound Asynchronous and an Abstract Interface for the LEGACY SYSTEM(Target Message). I didn't create any Abstract interface for the IDOC(Source message). I am getting this error

  • Trigger calling ctx_ddl.sync_index problem

    Dear, In order to keep my context indexes up-to-date, I'm trying to write a trigger calling this PL/SQL procedure on update/insert/delete statement. However, there must be a problem in my trigger definition since it gives compilation errors! I don't

  • Save as JPG / Save for Web Failing / Crashing Photoshop CC

    I just recently moved to CC from CS5. Save as fails everytime. Crashes the app sometimes. Using a MacBook Air. Not sure what other info y'all might need to diagnose this problem. Please Help.

  • Is there a free MySQL driver?

    Dear All, Thank you for your replies to my previous posting. I explored the JDBC resources site that was indicated. It appears that the drivers that are available for MySQL have to be paid for. I was under the impression that a JDBC driver for MySql