• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ListDataEvent ...looks Stange...?

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have DefaultList Model which holds data.I am listening to this Model.When i get ListDataEvent.I got methods like getIndex0(),getIndex1() methods which barely says range of indices changed/removed/added.It Is easy to get Objects when there is change of existing Objects or new one added.Is there any work around you think to get what objects are removed from the Model.

Ex:

ListDataListener listner1=new ListdataListener(){

public void intervalAdded(ListDataEvent e){
}
public void intervalRemoved(ListDataEvent e){

}
public void contentsChanged(ListDataEvent e){
}
}
DefaultListModel model=new DefaultListModel();
model.addListDataListnere(listener1);
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No... the event is thrown after the data has already been removed from the model, so you can't get them from the model anymore...

If the data is held somewhere else other than the list model, you could iterate through the model and see if there are any extra data values, and you know those are removed...
 
Bhagya Tangutur
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's true...Thanks for your time to clarify me.with your answer i am clear that what am i expected is right.
[ December 24, 2002: Message edited by: Kumar T ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic