Forums Register Login

arrayList.remove()

+Pie Number of slices to send: Send
i've an arrayList and i want to use the remove() method, but when i do it on the first or last element, it delete the second or the one before the last element, what's the matter?
+Pie Number of slices to send: Send
Perhaps a code snippet showing how you're indexing the ArrayList might shed some light on the problem.
Sean
+Pie Number of slices to send: Send
Remeber that arraylist, arrays, start indexing at zero in Java. Verify that's not the problem.

Bosun
+Pie Number of slices to send: Send
the problem comes in fact from the way i pass the element to be deleted. I select it from a combobox doing MyCombo.getSelectedItem(), and it returns me a wrong element.
Think of how stupid the average person is. And how half of them are stupider than that. But who reads this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1277 times.
Similar Threads
html table to excel problem
Remove last element of string
Multiplying elements of two arrays together
Doubly Linked List
Array question
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 11:30:14.