请问各位高手~怎么把JTextField中文本写到JList中~~

解决方案 »

  1.   

    用List就OK!!!!!!!!!!!!!!!!!!!!!!!!1
      

  2.   

    ((DefaultListModel)jList.getModel()).set(int index, Object element) ;
    ((DefaultListModel)jList.getModel()).setElementAt(Object obj, int index);
    ------------------------------------------------------------------------------
     Object set(int index, Object element) 
              Replaces the element at the specified position in this list with the specified element. 
    ------------------------------------------------------------------------------
     void setElementAt(Object obj, int index) 
              Sets the component at the specified index of this list to be the specified object.