如何在java中显示在线聊天用户jlist? [英] How display online chat users to jlist in java?
本文介绍了如何在java中显示在线聊天用户jlist?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
i希望在java中实现聊天应用程序..有一个服务器和多个客户端可以连接到服务器,服务器接受客户端并在向量中存储客户端名称,所以我想显示向所有客户形成的那个向量,我该怎么办?
请给我答案,请给它一个明智的.....
thnk u ....
i want to implement chat application in java..there is one server and multiple clients can connected to server,server accepts clients and store clients name in the vector, so i want to display that vector to the all clients form , how can i do?
please give me answer,pls pls its argent.....
thnk u....
推荐答案
最简单:
将Vector转换为Array并推入JList。
更高级(有更多选项):
创建渲染器并让Jlist在模型上工作。
参考文献:
JList API文档 [ ^ ]
JList上的Java教程 [ ^ ]
simplest:
convert Vector to Array and push into JList.
More advanced (with more options):
Create Renderer and make Jlist work on Model.
References:
JList API Documentation[^]
Java Tutorials on JList[^]
这篇关于如何在java中显示在线聊天用户jlist?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文