aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes what does getModel do? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "what does getModel do?" Watch "what does getModel do?" New topic
Author

what does getModel do?

budsy remo
Ranch Hand

Joined: Sep 20, 2008
Posts: 103
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);
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2203
    
    7
How to Use Models
budsy remo
Ranch Hand

Joined: Sep 20, 2008
Posts: 103
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 ?
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2203
    
    7
Your question is about a JList and its model. 90% of the posted code has nothing to do with your question.

Post a SSCCE that demonstrates the problem.
budsy remo
Ranch Hand

Joined: Sep 20, 2008
Posts: 103
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 .
budsy remo
Ranch Hand

Joined: Sep 20, 2008
Posts: 103
class ContactEditorUI
{
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what does getModel do?