how move my string array in vector


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: how move my string array in vector

  1. #1
    Join Date
    Oct 2005
    Posts
    7

    how move my string array in vector

    hi master
    sir i have string array how i add that array in vector

    i tried flowing code
    but not give me restul

    String[] jlf = {"Muhammad","Fahim","Aamir"};

    vector.addElement(jlf);


    plsease give me idea how i add array in vector

    thank
    aamir

  2. #2
    Join Date
    Dec 2004
    Location
    San Bernardino County, California
    Posts
    1,468
    That you are doing should work ... as long as you are creating a vector object and then adding your String array to that vector object, such as:

    Vector myVector = new Vector();
    myVector.addElement(jlf);

    This is a place where you could use "Generics" in declaring your vector as holding elements which are arrays of Strings, to allow the compiler to do type checking for you when adding elements to the vector:

    Vector<String[]> myVector = new Vector<String[]>();

  3. #3
    Join Date
    Oct 2005
    Posts
    7

    how i fill the combobox with vector

    thank for your reply

    hi master
    sir how use vector in combobox

    or how i fill the combobox with vector

    thank

    aamir

  4. #4
    Join Date
    Mar 2004
    Posts
    78
    Amir needs to copy the contents of an array to a vector!

    String[] strs = new String[]{"a", "b"};

    Vector v = new Vector();

    v.addAll(Arrays.asList(strs));

    Now the vector is filled with strings "a" and "b".

    JList list = new JList(v); // will work

Similar Threads

  1. Packed Data(Comp-3, etc)
    By Marcos in forum VB Classic
    Replies: 3
    Last Post: 01-25-2006, 12:18 PM
  2. Create String from String Array [Java]
    By Shaitan00 in forum Java
    Replies: 1
    Last Post: 02-28-2005, 10:58 AM
  3. Input string was not in a correct format
    By mdengler in forum ASP.NET
    Replies: 0
    Last Post: 11-26-2002, 03:32 PM
  4. VB/C Array parameters
    By Gastao Woelfert in forum VB Classic
    Replies: 2
    Last Post: 09-01-2000, 12:36 PM
  5. Deadlock error.. how to remove
    By Chandra in forum VB Classic
    Replies: 0
    Last Post: 06-22-2000, 01:52 PM

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