Deleting more than one row at a time

Hey all,
Im trying to be able to delete rows from my arraylist and UI table but im getting Index out of bounds exep.
I think its because of the numbering, like counting through the i in the for loop is making it look at something different.
Can anyone help?
Thanks!
selectedObjects = table.getSelectedRows();
            if (selectedObjects.length != 0)
               for (int i = 0; i < selectedObjects.length; i++)
                    table.deleteRow(selectedObjects);
rows.remove(selectedObjects[i]);

I think its because of the numbering, like counting
through the i in the for loop is making it look at
something different.This is exactly correct.
Personally I would look to see if those objects have a method named "clear" or "removeAll" or something like that, so you don't have to write that loop at all.
But if you do have to write the loop, write a loop that continuously deletes the last entry until there aren't any more. This logic doesn't have the numbering problems that your code does.

Similar Messages

  • How do you delete more than one photo at a time on Iphone 3gs camera roll?

    How do you delete more than one photo at a time on the Iphone 3gs camera roll?

    You can't.

  • Is there a way to delete more than one photo at a time in the Photo application?

    Is there a way to delete more than one photo at a time in the application Photos in the iPad? Thanks.

    The links below have instructions for deleting photos.
    iOS and iPod: Syncing photos using iTunes
    http://support.apple.com/kb/HT4236
    iPad Tip: How to Delete Photos from Your iPad in the Photos App
    http://ipadacademy.com/2011/08/ipad-tip-how-to-delete-photos-from-your-ipad-in-t he-photos-app
    Another Way to Quickly Delete Photos from Your iPad (Mac Only)
    http://ipadacademy.com/2011/09/another-way-to-quickly-delete-photos-from-your-ip ad-mac-only
    How to Delete Photos from iPad
    http://www.wondershare.com/apple-idevice/how-to-delete-photos-from-ipad.html
    How to: Batch Delete Photos on the iPad
    http://www.lifeisaprayer.com/blog/2010/how-batch-delete-photos-ipad
    (With iOS 5.1, use 2 fingers)
    How to Delete Photos from iCloud’s Photo Stream
    http://www.cultofmac.com/124235/how-to-delete-photos-from-iclouds-photo-stream/
     Cheers, Tom

  • How to delete more than one photo at a time

    Apparently there is no longer an iPhoto trash. So you don't drag photos to the trash. Instead you hit the delete key and then a second click on delete when you get the message "Are you sure you want to delete this photo." Has anyone found a way to delete more than one photo at a time, though? This is really a hassle if you have just imported 500 photos and are going to end up deleting 450 of them.

    I didn't say use the command key and delete. I use the command key for selecting random photos. Then I right click and choose delete from the contextual menu.
    I always use right click, but the command-delete does work also in that album.
    Depending on what album you are in, there are different menus. In a user created album, the right click would show "Remove from Album" & "Delete Photo". I noticed that was the same for Last Import Album. But at the same time, under image, you will only have Remove from Album. If it is a system album, you will only get the delete menu from either the right click or from the menu under Image.
    What you have to remember is if it days delete the photo, it will completely delete it from the library and all albums. If the menu says Remove From Album, then it will only be removed from the album you are in.
    In PhotoStream Album, you get only Delete Photo from the right click menu, but under image, you get only remove from album. So if you want to remove an image from PhotoStream, you have to use the top menu so it won't get deleted from the library. If you want to remove a photo completely, you would use delete and it will be removed from the library and photo stream.
    So, there are different processes for the different albums. I don't know if that is intentional or just oversight. That may change in the future.

  • Can I delete more than one message at a time

    Is it possible s to delete more than one message at a time and can I stop it putting them back on my phone once deleted??
    any help would be appreciated.
    thanks
    allisongs

    This question was answered here I think:
    https://discussions.apple.com/message/6799512#6799512

  • TS3899 How do I delete more than one email at a time from my i phone 5C

    How do I delete more than one email at a time from my i phone 5C

    With your Mail app open and the listing of the messages, tap Edit at the top right.  Then check each circle on the left side of the messages to delete.  When you have checked those to delete, tap Trash at the lower right.
    Next tap Mailboxes upper left, under accounts select the account, then for the account tap Trash.  Select Edit upper right, and at the bottom, Delete All, and confirm Delete All and all will be removed at one time.

  • I want to delete more than one song at a time from iTunes

    I want to delete whole albums from itunes. Is there a way to delete more than one song at a time?

    Or Command click on the songs if they are not consecutive on the list.

  • Deleting more than one file at a time from Nomad Jukebox Zen Xtra 4

    Is there a way to delete more than one file at a time from Zen Xtra? Actually, I'd like to delete most of the 800+ files and the only way I've found is to do them one at a time..! Help!

    Either use finder to drag and drop those tracks onto
    "Library" in iTunes' left "Source" column or from
    iTunes Menu Files use "Add to Library ..." then
    navigate to a folder that keep a yoru tracks and
    select that folder.
    This did it! I was doing an "import" which would only let me do one song at a time. But the "add to library" and the drag and drop both worked. Thanks!!!
    New Mac user
    Scott in Alaska
    MacBookPro   Mac OS X (10.4.5)  

  • Want to delete more than one song at a time

    I need to download the new ios 8.1.1 but don't have enough memory on my ipad. I would like to delete the songs on my ipad (school issued) without deleting songs in the cloud. I would also like to delete more than one song at a time. How can I do this?

    If by "in the cloud" you mean iTunes purchased tracks, deleting them from the device will not impact that. You will be able to redownload them later. To clear all tracks from the Music app: Settings app > General > Usage > Manage Storage [under STORAGE] > Music > All songs [swipe to the left] > Delete

  • Deleting more than one song at a time in iTunes

    Is there any way to delete more than one song at a time off of my ipod in iTunes? After I plug my ipod in, I see all of the songs on it listed in iTunes but when I want to delete 100 songs I have to right click on ech song one at a time and select "clear". Very time consuming....is there a quicker way?

    In Windows, you can select multiple things by holding the Ctrl key and clicking . . . then clear them all at once. If they're all together, you can hold the shift key, click the first, then the last and the whole 'batch' will be selected and can be deleted.

  • How do you delete more than one row on numbers?

    how do you delete more than one row on numbers?

    Hi operatorcarmax,
    Select the Rows (shift click works for me). Then hover the cursor over any selected Row label to see the upside-down triangle. Click on it to see a Pop-up menu.
    The Numbers User Guide is available for download under the Numbers Help Menu. A good read.
    Regards,
    Ian.

  • Is there a way to delete more than one email at a time on my iPad?

    Is there a way to delete more than one email at a time on my iPad?

    At the same instant?  No.
    Can you select five or six emails within about 5 seconds?  Yes - one at a time.

  • Is there a way to delete more than one layer at a time?

    As you would with regular files. I can't seem to highlight more than one layer at a time. I also tried linking the layers to be deleted but that didn't work either. Am I trying to do the impossible?

    Try;
    V+backspace then enter.
    On photoshop elements 1,2 and 3 this deletes only
    the layer that is selected, not the layers linked to it.
    On photoshop elements 4,5,6,7 and 8 this deletes the
    selected layer or layers.
    MTSTUNER

  • Delete more than one picture at a time

    how can i delete more than one picture at time??

    select them and drag to the iPhoto trash or press the delete key - then empty the iphtoo trash and the system trash
    LN

  • Deleting more than one contact at a time

    Iphone6
    How do I delete more than 1 contact at a time?

    Download the free app called My Contacts Backup. The app will allow an easy way to wipe out all of the contacts on the device. This feature is accessed by scrolling all the way down on the main app screen. Note that this does NOT allow you to select multiple contacts to delete but rather only allows you to delete the ENTIRE contacts list. There may be other contacts apps in the App Store that will allow you to select which you want to delete but I have no experience nor can comment on which apps those are.
    As you've found, iOS's Contacts app does NOT allow you to bulk-delete contacts. You need to use an additional app.

Maybe you are looking for

  • Undo GR with a deleted delivery note

         Hello, I don´t know if somebody has been in the same situation and could help or give us a solution: We would like to undo the Goods receipt from a Purchase order, but SAP doesn´t allow it due to the delivery note has been canceled by mystake. T

  • Parsing xml with dom4j - cannot find jar file

    Hi, I'm using Jdeveloper 10g and tomcat 5.5.9. I have a servlet which calls a java class (ParseXML.java) that trys to parse an xml string using dom4j. A snippet of ParseXML.java... import org.dom4j.Document; import org.dom4j.DocumentException; import

  • Lightroom 5.6 Win8 64 import of some photos are not possible

    Lightroom 5.6 Win8 64 import of some photos are not possible: the photos are grey, the file name of the photos are already excisting in the catalog, older different photos, don't Import Suspected Duplicates is not selected. There is no difference sel

  • Running MDX Query in BEX

    I've a question regarding MDX Query . 1.Can we run MDX Query in BEx. 2.If yes , then can you please tell me how and where can we run MDX Query in BEx. Regards, -Neha

  • Numeric value  (5-7) should return 2

    Hello. I've programmed in other language and there I could use: abs(5-7) if I want it to return 2 here and not -2. how can I do this in java? Regards