Article View: borland.public.jbuilder.java.language
Article #20082How work removeElementAt in java.util.Vector ?
From: Mok Chenda
Date: Thu, 30 Oct 1997 00:00
Date: Thu, 30 Oct 1997 00:00
27 lines
1083 bytes
1083 bytes
I have the following code :
Vector mCritereUtilisateur = new Vector();
When i click on Button1 : i add string in my Vector
...............
String vTemp;
vTemp = a value;
mCritereUtilisateur.addElement((String)vTemp);
But when i want to delete a element, it's doesn't seem to work :
Button 2 : removing the last element of my vector
.............................
int index = mCritereUtilisateur.size();
System.out.println("Numero de index = " + index);
if (index > 0) {
mCritereUtilisateur.removeElementAt(index);
}
I have an error like :
Exception occurred during event dispatching:
java.lang.ArrayIndexOutOfBoundsException: 1 >= 1
Thanks for you're response
Mok Chenda
Technical Details
Message-ID:
<01bce561$f73dc460$1d4602c2@titan>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,5ebec6c16aaca00c,start X-Google-Attributes: gidf74b3,public From: "Mok Chenda" <mok@fra.fr> Subject: How work removeElementAt in java.util.Vector ? Date: 1997/10/30 Message-ID: <01bce561$f73dc460$1d4602c2@titan> X-Deja-AN: 286033332 Organization: FRA Newsgroups: borland.public.jbuilder.java.language