/** * ClassName: UserListModel.java * Author: qiujy * CreateTime: 2009-4-15 * EMAIL: qjyong@gmail.com * Copyright 2009 ++YONG All rights reserved. */ package client.model.entity; import java.util.List; import javax.swing.AbstractListModel; import common.model.entity.User; /** 在线用户JList的Model */ public class OnlineUserListModel extends AbstractListModel { private static final long serialVersionUID = -3903760573171074301L; private List<User> onlineUsers; public OnlineUserListModel(List<User> onlineUsers) { this.onlineUsers = onlineUsers; } public void addElement(Object object) { if (onlineUsers.contains(object)) { return; } int index = onlineUsers.size(); onlineUsers.add((User)object); fireIntervalAdded(this, index, index); } public boolean removeElement(Object object) { int index = onlineUsers.indexOf(object); if (index >= 0) { fireIntervalRemoved(this, index, index); } return onlineUsers.remove(object); } public int getSize() { return onlineUsers.size(); } public Object getElementAt(int i) { return onlineUsers.get(i); } public List<User> getOnlineUsers() { return onlineUsers; } }

微信网友_7556333962743808 LV1
6月17日
WenMeng LV9
2024年12月30日
13133117021 LV5
2024年12月24日
矿泉水 LV30
2024年10月8日
你们的代码都是我的了 LV16
2024年4月29日
等风来2020 LV3
2023年12月10日
buhuia LV4
2023年6月9日
yangguang LV8
2022年12月28日
dongandmin LV9
2022年12月10日
caohanren LV11
2022年12月9日

微信网友_7556333962743808 LV1
6月17日
微信网友_7556333806571520
6月16日
暂无贡献等级
gfbuhbaduiei
1月9日
暂无贡献等级
WenMeng LV9
2024年12月30日
13133117021 LV5
2024年12月24日
MQ-EQW
2024年12月20日
暂无贡献等级
葫芦马戏 LV1
2024年12月11日
Sotouch LV15
2024年12月9日
Wq1008611
2024年11月28日
暂无贡献等级
3263394665 LV9
2024年8月31日