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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

JTextPane max amount of text

  • 24-07-2002 4: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, Registered Users 2 Posts: 2,013 ✭✭✭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, Registered Users 2 Posts: 2,013 ✭✭✭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