本文實(shí)例為大家分享了java聊天工具的具體制作代碼,供大家參考,具體內(nèi)容如下
成都創(chuàng)新互聯(lián)-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價(jià)比港閘網(wǎng)站開發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫,直接使用。一站式港閘網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋港閘地區(qū)。費(fèi)用合理售后完善,10年實(shí)體公司更值得信賴。
首先建立一個(gè)工程,導(dǎo)入數(shù)據(jù)庫驅(qū)動(dòng)
工程圖
解釋一下 entity包是 bin目錄 Message包下 和 User包下 是對(duì)象相關(guān)的操作
Message
package com.FakeQQ.entity; import java.util.Date; public class Message { //需要序列化發(fā)送,所以要繼承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 { //這叫實(shí)體bin private int qqNumber; private String qqName; private String qqPassword; private Date registTime; //注冊(cè)時(shí)間 private String sex; private String introduce; //個(gè)人簡(jiǎn)介 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; } }
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持創(chuàng)新互聯(lián)。
網(wǎng)頁題目:java制作帶界面的聊天工具
URL標(biāo)題:http://jinyejixie.com/article46/jjgchg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站排名、定制網(wǎng)站、用戶體驗(yàn)、網(wǎng)站營(yíng)銷、、商城網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)