//package poo;

import javax.swing.DefaultListModel;
import javax.swing.JList;

public class JListMutable extends JList 
{
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;


	public JListMutable() 
    {	
            super(new DefaultListModel());
    }
    	
    public DefaultListModel getContents()
    {
           return (DefaultListModel)getModel();
    }
    
    public void addElement(Object obj){
    	getContents().addElement(obj);
    }
    
    public void addArrayElements(Object[] obj)
    {
    	for(int i = 0; i < obj.length ; i++)
    		addElement(obj[i]);
    }
    
    
    public void limpiar(){
    	getContents().removeAllElements();
    }
    
 
    // for adding to the dynamic list in runtime
   // mutableList.getContents().addElement(Object obj);
 
}
