Java curriculum design team -socket chat room (Day2)
Construction of the database:
First, create multiple users in the user management and give the highest authority to facilitate team members to access and manage the database:
Second, create each user's information table (such as cxxx, hhb, test) and total user table (user)
Information table name for the corresponding user name field contains the name of the sender information side (hisName), Flag (1 for someone else to give me the information, two for me to someone else's information), Type (1 is offline messages, 2 historical news ), message (message) is transmitted, the transmission time (time)
User table contains a list of all registered users, the field contains the user name (userName), account password (passWord)
Mysql statement used type
Insert statements | INSERT INTO table_name(field1,filed2,...,filedN) VALUES ( value1, value2,...valueN ); |
---|---|
check sentence | SELECT colum_name,column,name FROM table_name [where Clause]; |
Delete statement | DELETE FROM table_name [WHERE Clause]; |
Update statement | UPDATE table_name SET field1=new-value1, field2=new-value2 [WHERE Clause]; |
Create a statement | CREATE TABLE table_name (column_name column_type); |
Gui graphical interface design
Create a login window
In the window that initially generated using NetBean pull on the login screen
NetBean control function limitations automatically generated not increase the background image, and later have a method to rewrite function of rewrite build a new window
addMouseMotionListener()//重写窗口拖动代码 addFocusListener()//重写获取焦点方法 mousePressed()//重写鼠标点击方法
Use getSource () method can be used as key actuation TextFiled, make the interface more attractive
Finally, reference material resulting interface
Sign up window creation
Java curriculum design team -socket chat room (Day1)