Good way to have a Collection Listener?

前端 未结 5 1123
梦谈多话
梦谈多话 2021-02-07 04:24

Is there a better way to have a listener on a java collection than wrap it in a class implementing the observer pattern ?

5条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-07 05:21

    Well, if you don't actually need a java.util.Collection or List instance, you could use a DefaultListModel. I'm not aware of any "real" Collection implementations with builtin listener/observer support.

提交回复
热议问题