Vectors/Arrays


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Vectors/Arrays

  1. #1
    Join Date
    Jan 2006
    Posts
    67

    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]);

  2. #2
    Join Date
    Mar 2005
    Location
    UK, London
    Posts
    150
    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.

  3. #3
    Join Date
    Jan 2006
    Posts
    67
    did I not create it with this: vt1 = new Vector();
    The contents of this vector are in a seperate class.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center