Trying to update JEditorPane in a loop

I have a loop running going through a list of urls. The first loop prints to the pane, but the rest just throw an exception and the command line shows "invalid insert". The command line shows the position as 96, which should be about right. I don't know if this has to do with the loop, but since it runs fine the first time, and the loop keeps processing despite the exception, I've got to think this has something to do with getting the length inside a loop..
                position = jEditorPane1.getText().length();
                try
                    jEditorPane1.getDocument().insertString(position, "Processing: " + userURL, null);
                catch(javax.swing.text.BadLocationException e)
                    logger.debug(e.getMessage());
                    logger.debug(position);
                }

Based on the 2 lines of code you posted the code looks fine, but who knows how this code is executed in the context of the rest of your program.
I generally use:
int position = textComponent.getDocument().getLength();
which is more efficient then rebuilding the text string from the Document, especially if you are looping, but it shouldn't be the cause of your problem.
If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.

Similar Messages

  • HT5642 my ipod touch 5th gen is not recognized since I tried to update ios. It says it is in recovery mode but it just keeps looping back to recovery mode. I tried holging power button for 3 sec. then both home and power for 10 sec then home button for 20

    My ipod touch 5th generation went into recovery mode when I tried to update ios. When I try to recover it just keeps looping back to recovery mode. I tried to hold the power button for 3 secs. then simultaneously hold the home button for 10 secs. then hold only power button for 20 secs. I tried this several times to no avail. This is my daughter's ipod. I am computer illiterate and I'm not sure what else to try.

    Maybe:
    Restore loop (being prompted to restore again after a restore successfully completes)
    Troubleshoot your USB connection. If the issue persists, out-of-date or incorrectly configured third-party security software may be causing this issue. Please follow Troubleshooting security software issues. .
    Next try placing in DFU mode and then restoring.
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    Then try restoring on another computer.
    Last, make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar

  • Tried to update ipod touch software now stuck in recovery loop any ideas?

    tried to update software on brand new ipod touch but now stuck in recovery mode (displaying usb plug into itunes logo) any ideas?

    Maybe:
    Restore loop (being prompted to restore again after a restore successfully completes)
    Troubleshoot your USB connection. If the issue persists, out-of-date or incorrectly configured third-party security software may be causing this issue. Please follow Troubleshooting security software issues. .
    Next try placing in DFU mode and then restoring.
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    Last, try restoring on another computer.

  • I'm trying to update my software to iTunes 10.5.2.  I click on the install button, click the Accept button, the software checks for updates, and then I am back at the original download screen.  I can't seem to get past this loop.  Any suggestions?

    I'm trying to update my software to iTunes 10.5.2.  I click on the install button, click the Accept button, the software checks for updates, and then I am back at the original download screen.  I can't seem to get past this loop.  Any suggestions?

    If I go through the setup that you suggested, won't I screw up the existing software on my system?
    No. The iTunes installer will first uninstall the existing version of iTunes and then put in the new one. (That's actually also what happens when you use Apple Software Update to install a new version ... it just doesn't show the uninstall phase like the iTunes64Setup.exe or iTunesSetup.exe does.)

  • I tried to update to mavericks which made my MacBook unworkable. I reformatted with my startup disc and now have reloaded my computer from a backup on time capsule. I keep getting a panic screen on start up and can't get out of this perpetual loop?

    I tried to update to mavericks but it crashed my system. I reformatted and restored from time capsule but have a panic screen I can't get out of.

    Read this thread.
    https://discussions.apple.com/message/22935993#22935993
    Linc Davis is a very smart guy on here, and his recommendation in that thread is to reinstall the OS. I'd suggest a backup first.

  • HT1212 I am unable to get our of a continuous cycle when trying to update or restore my iPad 2. Plug in to iTunes 12.0.1 (latest version). Click update, told can't update, have to restore. Restore fails with error 9. Any help appreciated.

    When I tried to update my iPad I got an error 9. Now, I am unable to access my iPad. It is in a continuous cycle when I try to update or restore the iPad 2. Plug in to iTunes 12.0.1 (latest version). Click update, told can't update, have to restore. Restore fails with error 9. Any help appreciated.
    Here's the cycle:
    I plug in my iPad when “cable to iTunes shows on iPad screen. It says "Your iPad can't be updated, you must restore it to factory settings." That bad enough news, but it gets worse.
    Click Restore
    Extracting software…
    Preparing iPad for restore
    Waiting for iPad…
    Verifying iPad restore with Apple…
    (empty bar under the Apple logo…does not show any activity)
    “The iPad “iPad” could not be restored. An unknown error occurred (9).”
    Notes: I just upgraded to OS X Yosemite 10.10.1 on my iMac (27-inch, Mid 2011) in the last week. It’s the first time I’m tried to backup/update my iPad since the iMac update.
    I swapped out the USB cable to a new cable and get the same results.
    I also unplugged all other USB devices from the iMac and security on my iPad and still get the same results.
    I find it strange that it shows no Serial number for my my iPad 2 when plugged in. It shows “Serial Number: n/a on the screen when it displays: “iPad Recovery Mode To update your iPad without erasing its contents, click Update. To restore your iPad to its factory settings, click Restore iPad.
    I prefer to update my iPad, but it displays “Your iPad can’t be updated, you must restore it to factory settings. If you previously backed up the iPad, click Restore Backup after the restore process completes.”
    It’s a continuous loop. I get the display on my iPad to plug in the iPad to iTunes, plug it in which ends after going through the above procedure saying an error occurred (9).
    So now I cannot use my iPad. When I turn it on I get the display showing me to plug it into iTunes with the cable. Since this is the only option I have I plug it in and the loop begins.
    Any advice would be appreciated.
    Thanks!

    Hello jaybearden,
    Thanks for the question. After reviewing your post, it sounds like you are not able to restore the iOS device since you get an error 9. I would recommend that you read this article, it may be able to help the issue.
    Resolve iOS update and restore errors - Apple Support
    Check your security software
    Related errors: 2, 4, 6, 9, 1000, 1611, 9006. Sometimes security software can prevent your device from communicating with either the Apple update server or with your device.
    Check your security software and settings to make sure that they aren't preventing a connection to the Apple servers.
    Thanks for using Apple Support Communities.
    Have a nice day,
    Mario

  • My phone is not working after i tried to update it to IOS 8!

    Hello everyone, i hope that you can help me with my problem!
    Yesterday i tried to update my Iphone 5s to ios 8 via itunes on my mac. After a while it displayed that there was an error an it stopped. After that i tried to open my phone and it was in recovery mood! i couldn't get out of the recovery mode so i searched my problem online and it said that i have to download a program called Recboot. I did and it had two optiond either to exit or enter the recovery mode and i pressed exit of course but then it started to show the apple logo then it flashes a blue screen then goes off then the apple screen again and everything goes in a loop and never stopes until i completely close the phone! now my laptob can't even identify the phone, so i can't even recover it or restore it and i don't know what to do! Please HELP me, i'm desperate

    I had the same problem, I connected to a different computer that had itunes. It also was oneI never connected to before. I held the power botton and homebutton till it showed up connect to itunes. I opened up it tunes and it said my phone needed a phone software update, i folled the prompt and set it up as a new phone. Then i resored it, then put it on the computer u usually sync it on and restore it to a date the phone was working to, this helped me, if u want i can help u over the phone if u cant get it, let me know and i will send u my number over my email address, hope it works, basically i swiped the phone clean and reinstalled all software by taking these steps

  • IPhone4S: tried to update to iOS6 and now will only show "connect to iTunes" screen

    I've got an iPhone4S and tried to update to iOS6 via iTunes.  While installing, a message came up on my computer saying that "iOS6 could not be installed due to an unknown reason" (I'm paraphrasing b/c I didn't write it down, figuring that I could just re-do it).  Ever since that message came up, neither iTunes or my computer recognizes that the phone is plugged in.  Also the phone sceen is stuck on the "connect to iTunes" screen, which displays the USB cable with an arrow pointing to an iTunes logo.  I've done the 10 seconds reset, updated iTunes, etc., and everything else that the iPhone troubleshooting suggests.  Nothing is working, and my phone is totally un-usable.  PLEASE HELP!!! Thanks!

    1)I tried tinyumbrella. But it stills stucks in Recorvery Loop.
    2)Tried also using DFU mode buty tinyumbrella isn't detecting the device in DFU mode.
    3)I also tried iRecovery and results are same.
    4)Is there anyother way to break the recovery loop as i don't have any backup for my device.

  • Im trying to update db table in  user exit, with the internal table

    Im trying to update db table in user exit, with the internal table
    my scenario:
    loop at itekpo.
    updating itekpo -
    > at the end of user exit the db table ekpo have to be updated
    endloop.
    Im updating internal table, using 
    MODIFY itekpo TRANSPORTING INCO1 INCO2  WHERE ebeln = itekpo-ebeln
    where itekpo is internal table, but it is not updating the db table 'ekpo'.
    i also tried updating ekpo directly !
    Thanks in advance

    Hi,
    you can search in the forum itself,
    Try this link for instance
    https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=tocreateaBADI&adv=false&sortby=cm_rnd_rankvalue
    You can find a code for finding BADI as a report with the following Transaction
    finding badis
    How to find BADIs
    Reward if helpful
    Regards
    Byju

  • I can't update Instuments and Apple Loops

    I don't know what is going on here with the Garageband update "Instruments and Apple Loops".
    Everytime when I try to install I got this error below:
    "The update “GarageBand Instruments and Apple Loops” can’t be installed.
    The update could not be verified. It may have been corrupted or tampered with during downloading. The update will be downloaded and checked again the next time that Software Update runs."
    I tried many times and no sucess.
    I tried to repair the HD and permissions and still nothing.
    This only occurs with this update, the others work fine.
    I search the forum for same problem and I found a lot of treads tell to choose the third option ( install from DVD) but I dont have this option here in my Garageband. When I click in a instrument the garageband show me a window with two options. "Download Now" or "Download Later".
    Any suggestion ??
    Thanks
    Adriano
    Macbook Pro i7 2.2GHz
    Mac OS X 10.7.4
    4Gb Ram
    300+ free HD
    Garabeband 6.0.5

    HI Dahoveed,
    When i bought this macbook the software is OS X Mountain Lion (Early 2011)
    btw i got what you mean.
    Thank You.

  • Trying to update channels in real time while controlling Agilent 34970a

    Hello all,
    I've gotten such valuable help on these forums and I am hoping that someone will be able to point me in the right direction with this issue. I'm still pretty new to LabVIEW so please bear with me.
    I am working with the LabVIEW driver for the Agilent 34970A connected over a GPIB-ENET 100/1000. The device was detected and works just fine. The reason I am writing today is that I am trying to update the channel list in real time. Currently I need to stop the whole process in order to edit the channel list but due to the nature of the tests we will be performing it is important that I can add more channels as I go without interrupting the testing going on.
    I've searched the forums and tried modifying the channel string control to "Update value while typing," and "Limit to single line." The motivation behind the latter change was so that I could modify the channel list and use the ENTER key to execute. I've also tried creating a while loop with shift registers but the construction ws so clumsy that it did not work either.
    I am pretty sure that the modification should occur right at the string control but cannot be certain since the pint is for it to reinitialize what channels to scan and that occurs further down in the VI. I've attached the VI I am working with; it is an only slightly modified version of the driver's Advanced Scan Example. 
    Thank you all in advance,
    Yusif
    Solved!
    Go to Solution.
    Attachments:
    HP34970A Advanced Scan Example_YN_5-16a-12.vi ‏77 KB

    You may have added a shift register, but you're not actually comparing anything. You need to compare the value of the control to the value of the data coming from the shift register to see if it changed. If so, change the scan list.
    If you need to have a delay after changing the scan list, then you should add the delay inside the case structure that calls the VI to reconfigure the scan list. You can use the Time Delay VI to cause the delay to occur after configuring the scan by using the error wires to force execution order.
    P.S. Your naming scheme for VIs implies that you are probably not using a source code control system. If so, you would be well served in taking the time to learn about source code controls systems and installing one. It's very easy, and there have been numerous threads in the LabVIEW forum on recommendations of source code control systems.
    Attachments:
    changed.png ‏15 KB

  • Unknow Error 56 trying to update to iOS 8.1

    tried to update to iOS 8.1 today, then the unknown error 56 poped up. iPhone 6 now cant be restored nor updated, got totally stuck. please... i am begging for help.

    I have the exact same problem, error 56.
    I get the iTunes restore screen but the restore fails 90% of the way through.
    I tried an over the air update last night that caused it.
    My phone often gets stuck in extended reboot loops and shows either red or blue screen on the reboot loop.
    The phone is un-restoreable now and I can't get a genius appointment for a week. I  paid nearly £800 and it's unusable, disappointed is not the word.

  • Trying to update apps

    Recently, I got a new replacement phone because of the iPhone 5 power button recall. I restored from my original's phone backup via iTunes, but now it won't allow me to update my apps.
    I keep getting this popup message, when trying to update any app and it doesn't disappear after tapping on "download". The message repeats itself in a continuous loop and pressing cancel doesn't help either.
    Has anyone been having this problem and if yes how do you fix it?

    I just contacted the Whatsapp developers with the same issue, because that's the only app where I have this problem.
    DO NOT DELETE THE APPS! For me, trying to delete the app and download it again failed. I got the same pop-up loop when I tried to download it again from the store.
    Again, this has only happened to me for Whatsapp, both update and download, but it's clearly an App Store issue.

  • 5s stuck after trying to update to 8.0.2

    I tried to update to 8.0.2 over the air and the phone is stuck on recovery mode loop . Every few minutes it flashes a blue screen.
    I tried to restore it after entering recovery mode via i tunes but wile downloading the update  the i tunes icon went away and one again i only get the apple logo and the blue flashing screen.
    I tunes stopped recognising the device.
    i can only turn off the device with the home & sleep button.
    Do i need to bring the device for service?

    That image on your iPhone is telling you it is recovery mode. You must connect it to your computer and then restore with iTune on your computer.

  • I am trying to update Adobe Bridge and Photoshop CS6, because it is not opening my CR2 files taken by my Canon 6D.  I have tried to go to help updates, and the software says that it is "Up to Date".  However, if I view the plug-in, it says that Camera R

    I am trying to update Adobe Bridge and Photoshop CS6, because it is not opening my CR2 files taken by my Canon 6D.  I have tried to go to help > updates, and the software says that it is "Up to Date".  However, if I view the plug-in, it says that Camera Raw is only version 7.1.  I can not find a direct download for Camera Raw 7.3, only the DNG converter, NOT CAMERA RAW!  Please Help!

    Did you fix your issue?  I am having the same one

Maybe you are looking for

  • IF ELSE Statement in Member Formula

    I believe that I am in my final step of completing my database. But, I need to create a member formula that converts lbs to kg. I have gotten help on this question in the past and have a basic formula that works. However, I have 2 exceptions to the f

  • My ipod wont let me listen to my music!!!

    ok so when i try to listen to my songs it keeps going to the next one. it wont let me listen to anything! i tried going to a playlist and shuffle but the same thing happens...is there anything i can do or do i have to send it in for a new one? whoeve

  • Problem in receiving messages via RFC Sender Adapter

    Hi, I have problems in receiving messages from SAP backens systems. Sometimes we are getting all messages sometimes not. Strange. We are transfering report-results via asynchronous RFC calls. To avoid big message sizes we split them up in max. 1000 r

  • Preloader - not loading movie

    Hi. I have a preloader on the first frame of my movie timeline. When i go to 'test scene', the preloader works and moves to the next frame to play the MC. When i go to 'test movie' the preloader sticks after all bytes have loaded. It does not move on

  • Send group mail

    hi all,     how can send group mails are attached to one name( ex:sap team: sapteam )  in reports . if it possable ,please send the code.