本文实例为大家分享了java聊天工具的具体制作代码,供大家参考,具体内容如下
成都创新互联-专业网站定制、快速模板网站建设、高性价比港闸网站开发、企业建站全套包干低至880元,成熟完善的模板库,直接使用。一站式港闸网站制作公司更省心,省钱,快速模板网站建设找我们,业务覆盖港闸地区。费用合理售后完善,10年实体公司更值得信赖。
首先建立一个工程,导入数据库驱动
工程图
解释一下 entity包是 bin目录 Message包下 和 User包下 是对象相关的操作
Message
package com.FakeQQ.entity; import java.util.Date; public class Message { //需要序列化发送,所以要继承Serializable接口 private int id; private String content; private int sender; private int receiver; private Date sendTime; private Date receiveTime; private int state; private int ip; public int getIp() { return ip; } public void setIp(int ip) { this.ip = ip; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public int getSender() { return sender; } public void setSender(int sender) { this.sender = sender; } public int getReceiver() { return receiver; } public void setReceiver(int receiver) { this.receiver = receiver; } public Date getSendTime() { return sendTime; } public void setSendTime(Date sendTime) { this.sendTime = sendTime; } public Date getReceiveTime() { return receiveTime; } public void setReceiveTime(Date receiveTime) { this.receiveTime = receiveTime; } public int getState() { return state; } public void setState(int state) { this.state = state; } }
User
package com.FakeQQ.entity; import java.util.Date; public class User { //这叫实体bin private int qqNumber; private String qqName; private String qqPassword; private Date registTime; //注册时间 private String sex; private String introduce; //个人简介 private String ip; public int getQqNumber() { return qqNumber; } public void setQqNumber(int qqNumber) { this.qqNumber = qqNumber; } public String getQqName() { return qqName; } public void setQqName(String qqName) { this.qqName = qqName; } public String getQqPassword() { return qqPassword; } public void setQqPassword(String qqPassword) { this.qqPassword = qqPassword; } public Date getRegistTime() { return registTime; } public void setRegistTime(Date registTime) { this.registTime = registTime; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public String getIntroduce() { return introduce; } public void setIntroduce(String introduce) { this.introduce = introduce; } public String getIp() { return ip; } public void setIp(String ip) { this.ip = ip; } }
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持创新互联。
网页题目:java制作带界面的聊天工具
URL标题:https://www.cdcxhl.com/article46/jjgchg.html
成都网站建设公司_创新互联,为您提供网站排名、定制网站、用户体验、网站营销、、商城网站
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联