DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
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.

Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links