Results 1 to 3 of 3

Thread: Document.insertString(); not working

  1. #1

    Thread Starter
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Document.insertString(); not working

    I have this code that is suppose to append text to a JTextPane, using the Document method insertString(). I can't seem to get the attribute argument right, so maybe one of you can point me in the right direction...

    Here is the one line of code giving me problems, just at the attribute argument

    Code:
    doc.insertString(lastPosition,s,(AttributeSet)null);

    doc == myTextPane.getDocument

    last pos == myTextPane.getSelectionEnd()

    and s == the string to be inserted


    It's just the atrributes part I can't seem to get working..

    Any ideas?


    Note: I hope im not anyoing anyone by positing to many questions, but it just seems like I have one problem after the next.

  2. #2

    Thread Starter
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: Document.insertString(); not working

    I can give the error message if needed...Just let me know.

  3. #3

    Thread Starter
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: Document.insertString(); not working

    never mind... All I had to do was set it to null instead of (AttributeSet)null

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width