Lew wrote:
NickName wrote:
Vector vector1 = new Vector();
...
Enumeration e = vector1.elements();
...
Daniel Pitts wrote:
Actually, this is no where NEAR compete.
There isn't a class defined, and there are no methods defined.
You are right to wonder where textArea1 is defined. :-)
How quaint: Vector and Enumeration. I remember those, from back when the JVM
came with a hand-crank to bootstrap it.
I urge you to think of replacing with List (implemented by your favorite
implementing class) and Iterator. At least the latter, if not the former.
- LewOk. I found the List class under AWT package. Now, I'm dumbfounded by
the following simple code that I created and generated the infamous
java.lang.NoSuchMethodError: main
err msg. IDE env: JBuilder 2005. What's wrong really?
TIA.
import java.awt.*;
public class myList {
public void main(String[] args) {
// instantiate a new list
List ls = new List();
// add items to the list
ls.add("D");
ls.add("o");
ls.add("n");
ls.add(" ");
ls.add("L");
ls.add("i");
// now display each item in original (entry) order
int i;
for (i=0; i < ls.getItemCount(); i++) {
System.out.println(ls.getItem(i));
}
}
}- Hide quoted text -- Show quoted text -- Hide quoted text -- Show quoted text -