hello everyone

i have a textfield ,and a listbox in core java
and i want.everytime i entered something in textfield,,should be add in jlist

i m using netbeans with Jframe Form

i m doing this coding in add button

String filenames[]= {"Tom","Joe","Ted"};
DefaultListModel model= new DefaultListModel();

for(int i=0; i<filenames.length;i++)
model.add(i,filenames[i]); // Entering initial data to list




but everytime i type value in textfield and click add button..it only display current value in jlist.,pprevious value has been gone