can somebody please explain that what exactly getModel does ? really confused . It's wriiten in it's description that it returns the model that contains it? then what is this model? jList.getModel()).addElement(object);
Thanks for the reply and the topic was helpful but it has lead me to another problem . If i update a model and if the model has already been added to the list like this :
i am mailing the whole code now
i included the string g just for finding out where i was going wrong . Now what i want this code to do is that whenever i click ok , the value in the combobox is appended to the list and not that the last value is rplaced with it . What exactly am i doing wrong ?
Joined: Jun 13, 2009
Your question is about a JList and its model. 90% of the posted code has nothing to do with your question.
sorry about that but still giving you some more details . In that code i didn't implement the ListSelectionListener interface because i am not selecting anything from the list just adding the values to the list . So on the button click the action taken by the listener should be to take the value selected in combobox and then append it at the end of the list , instead it overwrites the last value in list .