public class BcMasSearch extends JFrame
{
    private JList list;
    private Map map1;
     String str1 ;
     String str2 ;
    Vector vector = null;
    
    public BcMasSearch()
    {
        super("Bar Code Search");
        this.setSize(500,400);
        
        map1 = new HashMap();
        
        vector = codeVector();
        list = new JList(vector);      
        JScrollPane pCenter = new JScrollPane(list);
        
        Container container = this.getContentPane();
        container.add(pTop,BorderLayout.NORTH);
        container.add(pCenter,BorderLayout.CENTER);
           
    }
    
    public Vector codeVector()
    {
        BcDbBarcode oBcDbBarcode;
        oBcDbBarcode = new BcDbBarcode();
        Vector v = null ;
        String str3;
        String str4;
        Iterator item;
        
        map1 = BcDatabase.getBarcode("select * from bar_code ");
    
        item = map1.keySet().iterator();
        while(item.hasNext())
        {
             String strKey = (String)item.next();
             oBcDbBarcode = (BcDbBarcode)map1.get(strKey);
             str3 = oBcDbBarcode.getCODE();//可以遍历,查到有值
             str4 = oBcDbBarcode.getRUNNO();//可以遍历,查到有值
             v.addElement(str3);//报错!!不知道为什么!??
        }
          
        return v;
    }}
我想让list中添加vector,怎么做??
我上面的程序不能把vector加入到list中,,谢谢帮忙解答!!