Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Vectors/Arrays

How do I add an array list from another class to the init() list box.
I am trying to use this but my applet then shows a blank screen:

fNames = new JList(vt1);

vt1 = new Vector();
for(int i = 0; i < fList.length; i++) // add string element to vector
vt1.addElement(fList[i]);
[352 byte] By [CB77] at [2007-11-11 8:19:19]
# 1 Re: Vectors/Arrays
u added the vt1 in the Jlist but the vt1 has not yet been initalised. u are adding a vector that has not yet been created, not sure but it may be the problem. but the jlist under the for loop and see what happends.
major at 2007-11-11 22:35:49 >
# 2 Re: Vectors/Arrays
did I not create it with this: vt1 = new Vector();
The contents of this vector are in a seperate class.
CB77 at 2007-11-11 22:36:49 >