Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

JTextPane max amount of text

Options
  • 24-07-2002 5:48pm
    #1
    Closed Accounts Posts: 536 ✭✭✭


    I'm looking to insert a string into a TextPane in Java.
    However if I insert too big a string then I get the following error:

    javax.swing.text.StateInvariantError: infinite loop in formatting
    ........................

    What I'm wondering is, is there any function that I can call to tell me what the maximum amount of text that the text pane can hold?

    I tried getmaximumsize() but that as far as I can see only tells me the max dimensions of the text pane itself.


Comments

  • Registered Users Posts: 1,994 ✭✭✭lynchie


    How much text are you trying to put into it?

    Also, are you using a JTextPane or a JTextArea?


  • Closed Accounts Posts: 536 ✭✭✭flyz


    Originally posted by lynchie
    How much text are you trying to put into it?

    Also, are you using a JTextPane or a JTextArea?

    As much as I can :)

    It's a log which will be continously add more and more text.
    At the moment I'm getting chunks of data of size 2000 bytes at a time from a database and I get the error if I've more than 6 entries in the database.

    I need to know a definate value of the size of the amount of text I can add as I will be deleting some of the older data once I exceed this limit.


    I'm using JTextPane too btw


  • Registered Users Posts: 1,994 ✭✭✭lynchie


    I've thrown together a quick app to test how much you can put into it. I have gotten as far as roughly 34000 (34K) bytes before it throws the exception. There does seem to be a limit on it and i've checked the Sun Forums and although several people have had this problem there doesnt seem to be a definite answer as to whether this is a bug or a limitation.


Advertisement