Can't believe DefaultListModel didn't implement# Java - 爪哇娇娃g*g2006-07-21 07:071 楼List interface in Collection, Suns programmers suck big time.Have to manually sort a JList.
z*g2006-07-21 07:072 楼You should say the Swing team sucks.【在 g*****g 的大作中提到】: List interface in Collection, Suns programmers suck big time.: Have to manually sort a JList.
L*r2006-07-21 07:073 楼是有点不方便. 不过, 实现起来也不麻烦.Sun的例子:http://java.sun.com/developer/technicalArticles/J2SE/Desktop/sorted_jlist/index.html
g*g2006-07-21 07:074 楼太麻烦,我的list数据量也不大,直接extends DefaultListModel,加个sort方法,把所有数据导出到Vector, Collections sort一下,再放回去结束。如果要优化的话也就是用一下插入排序。【在 L*********r 的大作中提到】: 是有点不方便. 不过, 实现起来也不麻烦.: Sun的例子:: http://java.sun.com/developer/technicalArticles/J2SE/Desktop/sorted_jlist/index.html