当前位置:网站首页>[untitled] * * database course design: complete the student information management system in three days**
[untitled] * * database course design: complete the student information management system in three days**
2022-06-25 08:51:00 【Butterfly Love 676】
Database course design : Three days to complete the student information management system
Course title 1 Student information management system
1 System requirements analysis
New students enter the school every year 、 Old students graduate , There are various other personnel changes . How to effectively manage these students' information , Help schools and teachers master the situation of students , This is the function that the student information management system needs to complete .
1.1 System function analysis
The main function of this system is to collect students' personal information , In order to provide teachers with the situation of each student in school . The main functions of the system are :
Student personal information input , Include : full name 、 Gender 、 departments 、 Birthday 、 Native place 、 Source of students, etc .
Input of student mobility , Include : transfer from one department to another 、 Suspension of school 、 Go back to school 、 Drop out of school 、 graduation .
Input of reward and punishment .
Inquiry and modification of students' personal information , Including mobility, reward and punishment .
1.2 System function module design ( Divide )
The system can be decomposed into several modules according to the functional requirements of the system
Block to design the application interface separately , Pictured 1 Shown .
1.3 Relationship with other systems
Student information management system is an integral part of campus information management system . It's for other systems , Such as class information management system 、 Teaching management system 、 Transcript system 、 Dormitory distribution system, etc , Provide the basic information of students . At the same time, the class setting and department setting provided by other systems are required . These systems can use the same database , The number of direct calls to each other
According to the .
2 Database design
2.1 Database requirements analysis
According to the data flow chart in the previous section , You can list the following data items and data structures required to record student information :
Student : Student number 、 full name 、 Gender 、 Birthday 、 Native place 、 department 、 In class .
Punishment record : Record No 、 Level 、 The object of punishment 、 Recording time 、 Detailed description 、 Whether to take effect .
Reward record : Record No 、 Level 、 Reward object 、 Recording time 、 Detailed description .
Student status change record : Record No 、 Changes 、 Record object 、 Recording time 、 Detailed description .
Admission list Student personal information Input Personal information Student personal information Student status change record Reward record Disciplinary records dean's office transfer from one department to another , Study , complex learn , Drop out of school , graduation scholarship assessment Punishment Release from punishment Student Statistics Student information statistics chart 1、 Student information management system function module diagram student information management system Educational administration information input Personal information query and modification Freshman information input scholarship assessment Penalty records Change of student status 17 External data support required :
class : Class number 、 Class name 、 Department .
departments : Code 、 name .
3.1 Functional specifications
1、 Student personal information input
2、 Input of student status change
3、 Input of reward situation
4、 Input of punishment
5、 Inquiry and modification of students' personal information
3.2 User interface design
After completing the database creation and function description , We can move on to the next step , That is, designing the user interface . Because of this
The content of system management is relatively simple , And it is a part of campus management information system , So use a form with different tabs
To complete the system requirements 5 Features .
We divide the form of student information management system into ____ Major parts , Pictured ____ Shown .
1、 Creation of application main form
2、 Student personal information input interface
3、 Student status change input interface
4、 Reward status input interface
5、 Penalty input interface
6、 Student personal information query and modification interface
3.3 Implementation of each functional module
1、 Student personal information input
2、 Student status change input
3、 Reward status input
4、 Penalty input
5、 Inquiry and modification of students' personal information
4 system implementation
Above is the title description :
Project development model : Waterfall model
Project design process :
explain : Demand analysis is mainly aimed at student information management system , Need to be meaningful 、 feasible 、 reasonable 、 comprehensive ; Conceptual structural design : It mainly abstracts the requirements of two types of users , There is also the design of the database , You need to make the database store data to reduce redundancy , Satisfy BCNF, And it has integrity constraints , Ensure the integrity of the database 、 Security , Use E-R Model to express the data model ; Logical structure design : Need to put E-R Transform into relational data table and establish the logical structure of the database in combination with the database management system ; A physical structure design has been neglected since then , The main reason is that this part is not the focus of this course , test : It mainly needs to verify whether the requirements are met , Whether the function is perfect , Whether the interaction between modules is normal ; Operation and maintenance : This time does not involve the maintenance of the software for long-term use .
** System requirements analysis :** New students enter the school every year 、 Old students graduate , There are various other personnel changes . How to manage these students effectively Information about , Help schools and teachers master the situation of students . So there are mainly two types of objects using this system , One is students , The other is the administrator who manages student information .
Functional analysis : Students need to be able to view personal information , Reward 、 punish 、 Change of student status 、 Personal information , Among them, reward and student status change should also have the application function for students ; For another object Administrator , First of all, we need to be able to add, delete, modify and check student information , Then for the change of student status 、 Reward 、 Punishment also needs to be added, deleted, modified and checked , Finally, you need to complete the management of personal information , In order to improve the system , Add an announcement function , The announcement is made by the administrator , It can be sent privately or in groups .
Function module design :
user : Sign in 、 Check the change of student status and submit an application 、 Check the Scholarship Status and submit an application 、 View penalty records 、 Check the announcements sent by the administrator in groups and privately 、 Viewing and modifying personal information 、 Safety exit .
Administrators : Sign in 、 Basic information for students 、 Class management 、 Department management 、 Change of student status 、 scholarship assessment 、 Addition, deletion, modification and query of punishment records , View and modify personal information .
Database design :
Conceptual structural design :
The main entities are : user 、 Punishment record 、 Reward record 、 Record of student status change 、 Announcement records .
user : Student number 、 full name 、 Gender 、 Birthday 、 Native place 、 department 、 In class 、 Leaving a message. 、 Province 、 password .
Change of student status : Number 、 Student number 、 Change category 、 Time 、 describe 、 state
punish : Number 、 Student number 、 Types of punishment 、 Time 、 describe 、 state
Reward : Number 、 Student number 、 Types of rewards 、 Time 、 describe 、 state
Notice : Number 、 Issued by 、 Publishing objects 、 Publish content 、 Release time
class : Number , name , Monitor of the class
departments : Number , name
E-R Model :
Logical structure design :
Due to the change of student status 、 punish 、 Reward 、 Notice 、 class 、 The relationship between departments and administrators is one to many , And the relationship has only one attribute , So they are all added to the non administrator side , Into an attribute , Then each other module will create a basic table separately , The view is based on the basic table , However, in this lesson, there is no view to show information to users with different permissions , Instead, basic arithmetic operations are used to connect basic tables .
Relational schema table :
user ( Student number , full name , Gender , Class number , Department number , Date of birth , The household registration , password , identity , Leaving a message. )
punish ( Number , Student ID of the punished person , Penalty level number , Time , describe , state )
Punishment level table ( Penalty number , Penalty description )
Reward ( Number , The student number of the scholarship winner , Scholarship grade number , Time , describe , state )
Reward level table ( Award number , Scholarship description )
Change of student status ( Number , Student ID of the student who has changed his / her student status , Change type number , Time , describe , state )
Student status change type table ( Number , Change type )
Notice ( Number , Publisher , Publishing objects , Release time , Publish content )
class ( Number , Class name , Monitor of the class )
departments ( Number , The name of the Department )
The concrete realization of database :
student surface :
reward surface
reward_levels surface
punish_levels surface
Punishment surface
Notice surface
Changes surface
Change_code surface
department surface
Specific module implementation :
Sign in :
Page presentation :
Simple one JLable Used to set welcome , Then two JLable, Prompt the user to enter the account and password , Two JTextField entry , Then two JButton Component a prompt a reset , Layout of the page .
Through individuals ContentPane() Function to get the underlying panel , By the way, the function needs to inherit from JFrame, Pass in springLayout Parameters , Convenient layout SpringLayout springLayout=new SpringLayout().
Call the components in turn contdion.add() Functions are added to the panel in turn , Then pass the component name .setFont(new Font( typeface , Is it bold , size )) To set the style of each component , By component name .setPreferredSize(new Dimension( wide , high )) Set the width and height of each component .
Then the positioning of components in the page ,springLayout.putConstraint( SpringLayout.NORTH, Component name , distance ,SpringLayout.NORTH, Relative components ), This relative positioning can complete the positioning of components ,
Last use setSize() Function to set the screen size ,setDefaltColseOperation Function to set how the screen closes , The most important thing to remember is to set setVisible(true), In this way, the page can be displayed .
Incoming data :
After positioning the components , You can add binding events to the buttons , By component name .AddActionListener(new Class that handles events ), Then add an inner class inside the function public class Class name implements ActionListener, Which must be rewritten public void actionPerformed(ActionEvent e) Method .
How to get the value , Because the component set earlier is a member variable , The scope is valid for the entire function , By component name .getText() Method to get , User input value , For the reset button, call the component name .setText() Method is set to null , For the login button , The obtained data can be processed .
package com.yu.web.student;
import com.yu.handler.student.login_handler;
import javax.swing.*;
import java.awt.*;
public class student_login extends JFrame {
JLabel nameJlabel=new JLabel(" Welcome to the student management system ",JLabel.CENTER);
SpringLayout springLayout=new SpringLayout();
JPanel jPanel=new JPanel(springLayout);
JLabel idJlabel=new JLabel(" Student number :");
JTextField idText=new JTextField();
JLabel pwdJlabel=new JLabel(" password :");
JPasswordField pwdField=new JPasswordField();
JButton loginBtn=new JButton(" Sign in ");
JButton resetBtn=new JButton(" Reset ");
SystemTray systemTray;
TrayIcon trayIcon;
com.yu.handler.student.login_handler login_handler;
public student_login(){
super(" Student management system ");
login_handler=new login_handler(this);
Container container=getContentPane();
// Set the font
nameJlabel.setFont(new Font(" Chinese Xingkai ",Font.PLAIN,40));
Font font=new Font(" Regular script ",Font.PLAIN,20);
idText.setFont(font);
pwdField.setFont(font);
idJlabel.setFont(font);
pwdJlabel.setFont(font);
loginBtn.setFont(font);
resetBtn.setFont(font);
// The input box sets the size
idText.setPreferredSize(new Dimension(200,30));
pwdField.setPreferredSize(new Dimension(200,30));
nameJlabel.setPreferredSize(new Dimension(0,80));
// Add components to the panel
jPanel.add(idJlabel);
jPanel.add(idText);
jPanel.add(pwdJlabel);
jPanel.add(pwdField);
loginBtn.addActionListener(login_handler);
jPanel.add(loginBtn);
resetBtn.addActionListener(login_handler);
jPanel.add(resetBtn);
// Component layout
// Absolute positioning
Spring allWidth=Spring.sum(Spring.sum(Spring.width(idJlabel),Spring.width(idText)),Spring.constant(20));
int offsetX=allWidth.getValue()/2;
springLayout.putConstraint(SpringLayout.WEST,idJlabel,-offsetX,SpringLayout.HORIZONTAL_CENTER,jPanel);
springLayout.putConstraint(SpringLayout.NORTH,idJlabel,20,SpringLayout.NORTH,jPanel);
// Relative layout
springLayout.putConstraint(SpringLayout.WEST,idText,20,SpringLayout.EAST,idJlabel);
springLayout.putConstraint(SpringLayout.NORTH,idText,0,SpringLayout.NORTH,idJlabel);
springLayout.putConstraint(SpringLayout.EAST,pwdJlabel,0,SpringLayout.EAST,idJlabel);
springLayout.putConstraint(SpringLayout.NORTH,pwdJlabel,20,SpringLayout.SOUTH,idJlabel);
springLayout.putConstraint(SpringLayout.WEST,pwdField,20,SpringLayout.EAST,pwdJlabel);
springLayout.putConstraint(SpringLayout.NORTH,pwdField,0,SpringLayout.NORTH,pwdJlabel);
springLayout.putConstraint(SpringLayout.WEST,loginBtn,50,SpringLayout.WEST,pwdJlabel);
springLayout.putConstraint(SpringLayout.NORTH,loginBtn,20,SpringLayout.SOUTH,pwdJlabel);
springLayout.putConstraint(SpringLayout.WEST,resetBtn,50,SpringLayout.EAST,loginBtn);
springLayout.putConstraint(SpringLayout.NORTH,resetBtn,0,SpringLayout.NORTH,loginBtn);
container.add(nameJlabel,BorderLayout.NORTH);
container.add(jPanel,BorderLayout.CENTER);
setSize(600,400);
setLocationRelativeTo(null);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setResizable(false);
setVisible(true);
}
public static void main(String[] args) {
new student_login();
}
public JTextField getIdText() {
return idText;
}
public void setIdText(JTextField idText) {
this.idText = idText;
}
public JPasswordField getPwdField() {
return pwdField;
}
public void setPwdField(JPasswordField pwdField) {
this.pwdField = pwdField;
}
}
The process of getting data from a page :
First, conduct a round of investigation , Is to judge whether it is empty , It's empty , be JOptionPane.showMessageDiolog( page , Prompt information ) Pop up a prompt box for the user , Then call the function that accesses the database , And pass the data as arguments .
Connect to database : Import driven jar package ,mysql-connector-java-5.1.45.jar, Remember to modify jar The scope of the package , Effective for the project , And then load the driver class.forName(“com.mysql.cj.jdbc.Driver”), Last call DriverManager. getConnection(), Function to connect to the database , Three of these parameters , In turn, is , Database path , Database name , password , Because these steps need to be performed every time you access the database , So it becomes a function DBUtil.
package com.yu.handler.student;
import com.yu.dao.student.login;
import com.yu.pojo.student;
import com.yu.web.admin.admin_main;
import com.yu.web.student.student_login;
import com.yu.web.student.student_main;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class login_handler implements ActionListener {
student ss;
private com.yu.web.student.student_login student_login;
public login_handler(){}
public login_handler(student_login student_login){
this.student_login=student_login;
}
@Override
public void actionPerformed(ActionEvent e) {
JButton jButton=(JButton)e.getSource();
String text=jButton.getText();
if(" Reset ".equals(text)){
student_login.getIdText().setText("");
student_login.getPwdField().setText("");
}else if(" Sign in ".equals(text)){
String id=student_login.getIdText().getText();
char[] chars=student_login.getPwdField().getPassword();
String pwd=new String(chars);
if(id.length()==0||pwd.length()==0){
JOptionPane.showMessageDialog(student_login," User name or password cannot be empty ");
}else{
student stu=new student();
stu.setStudentid(id);
stu.setPassword(pwd);
login res=new login();
student s= res.dao(stu);
if(s==null){
JOptionPane.showMessageDialog(student_login," Wrong user name or password ");
}else{
if(s.getState()==0) {
new student_main(s);
student_login.dispose();
}else{
new admin_main(s);
student_login.dispose();
}
}
}
}
}
}
Processing of database results :
Access database functions through return Return the result of the visit , Then judge the result , If the account and password do not match, a prompt box will pop up , If correct, pass new Function name , Open a new page , The original page also passes .diapose() Function destruction , And it needs to be based on state To determine the identity of the login .
Since the implementation of other functions is very similar to that of the page, the specific repetition will not be discussed in detail , Just talk about the uniqueness of the module .
package com.yu.dao.student;
import com.yu.pojo.student;
import com.yu.util.DBUtil;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class login {
public student dao(student s){
Connection conn = DBUtil.getConnectDb();
String studentid=s.getStudentid();
String password=s.getPassword();
String sql = "select * from student where studentid='" + studentid + "' and password='" + password + "'";
PreparedStatement stm = null;
ResultSet rs = null;
student stu=null;
try {
stm = conn.prepareStatement(sql);
rs = stm.executeQuery();
while(rs.next()){
stu=new student();
stu.setStudentid(rs.getString("studentid"));
stu.setName(rs.getString("name"));
stu.setSex(rs.getString("sex"));
stu.setClas(rs.getString("class"));
stu.setDepartment(rs.getString("department"));
stu.setBirthday(rs.getString("birthday"));
stu.setNative_place(rs.getString("native_place"));
stu.setPassword(rs.getString("password"));
stu.setState(rs.getInt("state"));
stu.setLiuyan(rs.getString("liuyan"));
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
DBUtil.CloseDB(rs, stm, conn);
}
return stu;
}
public void xiugai(String string,String id){
Connection conn = DBUtil.getConnectDb();
String sql ="update student set liuyan='"+string+"' where studentid='"+id+"'";
PreparedStatement stm = null;
ResultSet rs = null;
try {
stm = conn.prepareStatement(sql);
stm.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
} finally {
DBUtil.CloseDB(rs, stm, conn);
}
}
}
Student main interface :
The page layout : For the page layout, this time we use BorderLayout Layout , To the north of the layout is a JLable Welcome to the student management system , West is the name of the person who logs in here , This is mainly through formal parameter calls getXXX Method , And then through JLable.setText() Set up , A small function is added , To the south of this part is a text field JTextArea, In this section, users can record some things and save reminders , You can log in next time to view .
The central module of the page is the main module , The other two parts are mainly filled for the sake of aesthetics , This part mainly contains ten buttons , Display on button : Inquire about the change of student status , Apply for change of student status , Query reward status, etc , This is the left part , The right part is a text field added to the scroll wheel to display the queried information , Because for a student, the student status changes , Reward , punish , Generally, the quantity is not large , So there is no query function .
For the setting of the wheel panel , Set... With the following statement :
jScrollPane=new JScrollPane(xianshikuang,
ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED
);
The first parameter is the component added to the wheel panel , The second one is to support the roller in the vertical direction , The third one is the roller in the horizontal direction . Another important point is , Set the size hour , To set the size of the wheel , Instead of setting the size of the internal component .
jScrollPane.setPreferredSize(new Dimension(900,700));
For different modules, use JPanel panel , You can set its border , Make each module area clear .
Border border1=new LineBorder(Color.lightGray,2);
jPanel2.setBorder(border1);
Next is event binding , More buttons , Talk about one as a demonstration , Everything else is the same .
Student status change button binding event : Bind events through the following functions
changes.addActionListener(new changes());
Then construct the inner class :
public class changes implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
…
}
}
And its internal function body is to call the function to access the database , Get the information , By component name .setText() Method , Display the information to realize .
If other functions are similar, we will not repeat them , Just remember to set the status to not approved when submitting the application .
package com.yu.web.student;
import com.yu.dao.student.login;
import com.yu.pojo.student;
import com.yu.util.DBUtil;
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.border.LineBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class student_main extends JFrame{
JLabel title=new JLabel(" Welcome to the student management system ");
JLabel huanying=new JLabel("");
JLabel jieshao=new JLabel(" The main function ");
JButton changes=new JButton(" Change of student status ");
JButton changess=new JButton(" Application for change of student status ");
JButton reward=new JButton(" Awards ");
JButton rewardd=new JButton(" Reward application ");
JButton punish=new JButton(" Punishment ");
JButton student=new JButton(" Personal information ");
JButton studentt=new JButton(" Personal information modification ");
JButton studenttt=new JButton(" Change Password ");
JButton tuichu=new JButton(" sign out ");
JButton gonggao=new JButton(" Notice ");
JLabel changestext=new JLabel(" Student status management ");
JLabel rewardtext=new JLabel(" Reward management ");
JLabel punishtext=new JLabel(" Punishment management ");
JLabel studenttext=new JLabel(" Personal information management ");
JLabel gonggaoText=new JLabel(" Announcement management ");
JLabel tuichutext=new JLabel(" sign out ");
JButton chongzhi=new JButton(" Reset ");
JButton liuyan=new JButton(" modify ");
// Used to save the user information of the current page
JLabel studentid=new JLabel("");
JLabel name=new JLabel("");
JLabel sex=new JLabel("");
JLabel clas=new JLabel("");
JLabel department=new JLabel("");
JLabel birthday=new JLabel("");
JLabel native_place=new JLabel("");
JLabel password=new JLabel("");
JTextArea tianchong=new JTextArea();
SpringLayout springLayout=new SpringLayout();
JPanel jPanel1=new JPanel();
JPanel jPanel2=new JPanel(springLayout);
JPanel jPanel3=new JPanel(springLayout);
JPanel jPanel4=new JPanel();
JScrollPane jScrollPane=new JScrollPane();
JTextArea xianshikuang=new JTextArea();
public student_main(){
}
public student_main(student s){
super(" Students log in to the main page ");
JPanel root=new JPanel();
this.setContentPane(root);
BorderLayout borderLayout=new BorderLayout();
root.setLayout(borderLayout);
student stu=s;
huanying.setText(s.getName());
// Save current user information
studentid.setText(s.getStudentid());
name.setText(s.getName());
sex.setText(s.getSex());
clas.setText(s.getClas());
department.setText(s.getDepartment());
birthday.setText(s.getDepartment());
native_place.setText(s.getNative_place());
password.setText(s.getPassword());
// Set the font
title.setFont(new Font(" Chinese Xingkai ",Font.PLAIN,100));
huanying.setFont(new Font(" Chinese Xingkai ",Font.PLAIN,100));
jieshao.setFont(new Font(" Song style ",Font.PLAIN,35));
tianchong.setFont(new Font(" Regular script _GB2312",Font.PLAIN,20));
Font font1=new Font(" Regular script ",Font.PLAIN,15);
Font font3=new Font(" Song style ",Font.PLAIN,20);
changes.setFont(font1);
changess.setFont(font1);
reward.setFont(font1);
rewardd.setFont(font1);
punish.setFont(font1);
student.setFont(font1);
studentt.setFont(font1);
studenttt.setFont(font1);
tuichu.setFont(font1);
gonggao.setFont(font1);
liuyan.setFont(font1);
chongzhi.setFont(font1);
changestext.setFont(font3);
rewardtext.setFont(font3);
punishtext.setFont(font3);
studenttext.setFont(font3);
tuichutext.setFont(font3);
gonggaoText.setFont(font3);
// The input box sets the size
chongzhi.setPreferredSize(new Dimension(100,50));
liuyan.setPreferredSize(new Dimension(100,50));
huanying.setPreferredSize(new Dimension(500,200));
jPanel2.setPreferredSize(new Dimension(400,300));
jScrollPane.setPreferredSize(new Dimension(500,200));
tianchong.setPreferredSize(new Dimension(350,350));
Dimension di1=new Dimension(150,50);
changes.setPreferredSize(di1);
changess.setPreferredSize(di1);
reward.setPreferredSize(di1);
rewardd.setPreferredSize(di1);
punish.setPreferredSize(di1);
student.setPreferredSize(di1);
studentt.setPreferredSize(di1);
studenttt.setPreferredSize(di1);
tuichu.setPreferredSize(di1);
gonggao.setPreferredSize(di1);
// Text field settings
tianchong.setForeground(Color.BLUE);
tianchong.setLineWrap(true);
tianchong.setText(s.getLiuyan());
xianshikuang.setLineWrap(true);
// Text domain
//
xianshikuang.setFont(new Font(" Regular script ",Font.PLAIN,20));
//
jScrollPane=new JScrollPane(xianshikuang,
ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED
);
jScrollPane.setPreferredSize(new Dimension(900,700));
jPanel1.add(title);
jPanel2.add(huanying);
jPanel2.add(tianchong);
jPanel2.add(liuyan);
jPanel2.add(chongzhi);
jPanel3.add(jieshao);
jPanel3.add(changes);
jPanel3.add(changess);
jPanel3.add(changestext);
jPanel3.add(reward);
jPanel3.add(rewardd);
jPanel3.add(rewardtext);
jPanel3.add(punish);
jPanel3.add(punishtext);
jPanel3.add(gonggao);
jPanel3.add(gonggaoText);
jPanel3.add(student);
jPanel3.add(studentt);
jPanel3.add(studenttt);
jPanel3.add(studenttext);
jPanel3.add(tuichu);
jPanel3.add(tuichutext);
jPanel3.add(jScrollPane);
// Positioning assembly
springLayout.putConstraint(SpringLayout.NORTH,jieshao,20,SpringLayout.NORTH,jPanel3);
springLayout.putConstraint(SpringLayout.WEST,jieshao,100,SpringLayout.WEST,jPanel3);
springLayout.putConstraint(SpringLayout.NORTH,changes,100,SpringLayout.NORTH,jPanel3);
springLayout.putConstraint(SpringLayout.WEST,changes,200,SpringLayout.WEST,jPanel3);
springLayout.putConstraint(SpringLayout.NORTH,changess,10,SpringLayout.SOUTH,changes);
springLayout.putConstraint(SpringLayout.WEST,changess,0,SpringLayout.WEST,changes);
springLayout.putConstraint(SpringLayout.NORTH,changestext,15,SpringLayout.NORTH,changes);
springLayout.putConstraint(SpringLayout.WEST,changestext,30,SpringLayout.WEST,jPanel3);
springLayout.putConstraint(SpringLayout.NORTH,reward,80,SpringLayout.SOUTH,changes);
springLayout.putConstraint(SpringLayout.EAST,reward,0,SpringLayout.EAST,changes);
springLayout.putConstraint(SpringLayout.NORTH,rewardd,10,SpringLayout.SOUTH,reward);
springLayout.putConstraint(SpringLayout.WEST,rewardd,0,SpringLayout.WEST,reward);
springLayout.putConstraint(SpringLayout.NORTH,rewardtext,15,SpringLayout.SOUTH,reward);
springLayout.putConstraint(SpringLayout.WEST,rewardtext,30,SpringLayout.WEST,jPanel3);
springLayout.putConstraint(SpringLayout.NORTH,punish,100,SpringLayout.SOUTH,reward);
springLayout.putConstraint(SpringLayout.EAST,punish,0,SpringLayout.EAST,changes);
springLayout.putConstraint(SpringLayout.NORTH,punishtext,15,SpringLayout.NORTH,punish);
springLayout.putConstraint(SpringLayout.WEST,punishtext,30,SpringLayout.WEST,jPanel3);
springLayout.putConstraint(SpringLayout.NORTH,gonggao,50,SpringLayout.SOUTH,punish);
springLayout.putConstraint(SpringLayout.EAST,gonggao,0,SpringLayout.EAST,changes);
springLayout.putConstraint(SpringLayout.NORTH,gonggaoText,15,SpringLayout.NORTH,gonggao);
springLayout.putConstraint(SpringLayout.WEST,gonggaoText,30,SpringLayout.WEST,jPanel3);
springLayout.putConstraint(SpringLayout.NORTH,student,50,SpringLayout.SOUTH,gonggao);
springLayout.putConstraint(SpringLayout.EAST,student,0,SpringLayout.EAST,changes);
springLayout.putConstraint(SpringLayout.NORTH,studentt,10,SpringLayout.SOUTH,student);
springLayout.putConstraint(SpringLayout.WEST,studentt,0,SpringLayout.WEST,student);
springLayout.putConstraint(SpringLayout.NORTH,studenttext,15,SpringLayout.SOUTH,student);
springLayout.putConstraint(SpringLayout.WEST,studenttext,30,SpringLayout.WEST,jPanel3);
springLayout.putConstraint(SpringLayout.NORTH,studenttt,70,SpringLayout.SOUTH,student);
springLayout.putConstraint(SpringLayout.EAST,studenttt,0,SpringLayout.EAST,changes);
springLayout.putConstraint(SpringLayout.NORTH,tuichu,50,SpringLayout.SOUTH,studenttt);
springLayout.putConstraint(SpringLayout.WEST,tuichu,0,SpringLayout.WEST,studenttt);
springLayout.putConstraint(SpringLayout.NORTH,tuichutext,15,SpringLayout.NORTH,tuichu);
springLayout.putConstraint(SpringLayout.WEST,tuichutext,30,SpringLayout.WEST,jPanel3);
springLayout.putConstraint(SpringLayout.NORTH,huanying,20,SpringLayout.NORTH,jPanel2);
springLayout.putConstraint(SpringLayout.WEST,huanying,50,SpringLayout.WEST,jPanel2);
springLayout.putConstraint(SpringLayout.NORTH,tianchong,300,SpringLayout.NORTH,jPanel2);
springLayout.putConstraint(SpringLayout.WEST,tianchong,25,SpringLayout.WEST,jPanel2);
springLayout.putConstraint(SpringLayout.NORTH,chongzhi,20,SpringLayout.SOUTH,tianchong);
springLayout.putConstraint(SpringLayout.WEST,chongzhi,50,SpringLayout.WEST,tianchong);
springLayout.putConstraint(SpringLayout.NORTH,liuyan,0,SpringLayout.NORTH,chongzhi);
springLayout.putConstraint(SpringLayout.WEST,liuyan,20,SpringLayout.EAST,chongzhi);
springLayout.putConstraint(SpringLayout.NORTH,jScrollPane,100,SpringLayout.NORTH,jPanel3);
springLayout.putConstraint(SpringLayout.WEST,jScrollPane,100,SpringLayout.EAST,changes);
// Define borders
Border border1=new LineBorder(Color.lightGray,2);
jPanel2.setBorder(border1);
jPanel1.setBorder(border1);
jScrollPane.setBorder(border1);
jPanel4.setBorder(border1);
root.add(jPanel1,BorderLayout.NORTH);
root.add(jPanel2,BorderLayout.WEST);
root.add(jPanel3,BorderLayout.CENTER);
root.add(jPanel4,BorderLayout.SOUTH);
// Monitoring events
chongzhi.addActionListener(new chongzhi());
liuyan.addActionListener(new liuyan());
changes.addActionListener(new changes());
changess.addActionListener(new changess());
reward.addActionListener(new reward());
rewardd.addActionListener(new rewardd());
punish.addActionListener(new punish());
gonggao.addActionListener(new gonggao());
student.addActionListener(new stu());
studentt.addActionListener(new sst());
studenttt.addActionListener(new xiu());
tuichu.addActionListener(new tui());
// JButton tuichu=new JButton(" sign out ");
Dimension screenSize=Toolkit.getDefaultToolkit().getScreenSize();
setSize(screenSize.width,screenSize.height);
setLocationRelativeTo(null);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setResizable(false);
setVisible(true);
}
public class chongzhi implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
tianchong.setText("");
}
}
public class liuyan implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
String string=tianchong.getText();
String id=studentid.getText();
login login=new login();
login.xiugai(string,id);
}
}
public class changes implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
String string="";
String id=studentid.getText();
Connection conn = DBUtil.getConnectDb();
String sql = "select states,id,student.name,change_code.description,rec_time,changes.description from changes,change_code,student where changes.studentid='"+id+"' and changes=change_code.code and changes.studentid=student.studentid";
PreparedStatement stm = null;
ResultSet rs = null;
student stu=null;
try {
stm = conn.prepareStatement(sql);
rs = stm.executeQuery();
while(rs.next()){
String pid=rs.getString("id");
String sname=rs.getString("student.name");
String ades=rs.getString("change_code.description");
String set=rs.getString("rec_time");
String chd=rs.getString("changes.description");
int state=rs.getInt("states");
if(state==1){
string=string+" Number :"+pid+"\n"+" full name :"+sname+"\n"+" operation :"+ades+"\n"+" Time :"+set+"\n"+" describe :"+chd+"\n"+" state : Approved "+"\n\n\n";
}else if(state==0){
string=string+" Number :"+pid+"\n"+" full name :"+sname+"\n"+" operation :"+ades+"\n"+" Time :"+set+"\n"+" describe :"+chd+"\n"+" state : unratified "+"\n\n\n";
}else if(state==2){
string=string+" Number :"+pid+"\n"+" full name :"+sname+"\n"+" operation :"+ades+"\n"+" Time :"+set+"\n"+" describe :"+chd+"\n"+" state : Rejected "+"\n\n\n";
}
}
} catch (SQLException ex) {
ex.printStackTrace();
} finally {
DBUtil.CloseDB(rs, stm, conn);
}
xianshikuang.setText(string);
}
}
public class changess implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
String st=studentid.getText();
new xuejishengqing(st);
}
}
public class reward implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
String string="";
String id=studentid.getText();
Connection conn = DBUtil.getConnectDb();
String sql = "select id,student.name,rewaed_levels.description,rec_time,reward.description,states from reward,rewaed_levels,student where reward.studentid='"+id+"' and reward.levels=rewaed_levels.code and reward.studentid=student.studentid";
PreparedStatement stm = null;
ResultSet rs = null;
student stu=null;
try {
stm = conn.prepareStatement(sql);
rs = stm.executeQuery();
while(rs.next()){
String pid=rs.getString("id");
String sname=rs.getString("student.name");
String ades=rs.getString("rewaed_levels.description");
String set=rs.getString("rec_time");
String chd=rs.getString("reward.description");
int state=rs.getInt("states");
if(state==1){
string=string+" Number :"+pid+"\n"+" full name :"+sname+"\n"+" Types of rewards :"+ades+"\n"+" Time :"+set+"\n"+" describe :"+chd+"\n"+" state : Approved "+"\n\n\n";
}else if(state==0){
string=string+" Number :"+pid+"\n"+" full name :"+sname+"\n"+" Types of rewards :"+ades+"\n"+" Time :"+set+"\n"+" describe :"+chd+"\n"+" state : unratified "+"\n\n\n";
}if(state==2){
string=string+" Number :"+pid+"\n"+" full name :"+sname+"\n"+" Types of rewards :"+ades+"\n"+" Time :"+set+"\n"+" describe :"+chd+"\n"+" state : Rejected "+"\n\n\n";
}
}
} catch (SQLException ex) {
ex.printStackTrace();
} finally {
DBUtil.CloseDB(rs, stm, conn);
}
xianshikuang.setText(string);
}
}
public class rewardd implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
String st=studentid.getText();
new shengqingreward(st);
}
}
public class punish implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
String string="";
String id=studentid.getText();
Connection conn = DBUtil.getConnectDb();
String sql = "select id,student.name,punish_levels.description,rec_time,enable,punishment.description from punishment,punish_levels,student where punishment.studentid='"+id+"' and punishment.levels=punish_levels.code and punishment.studentid=student.studentid";
PreparedStatement stm = null;
ResultSet rs = null;
student stu=null;
try {
stm = conn.prepareStatement(sql);
rs = stm.executeQuery();
while(rs.next()){
String pid=rs.getString("id");
String sname=rs.getString("student.name");
String ades=rs.getString("punish_levels.description");
String set=rs.getString("rec_time");
String ena=rs.getString("enable");
String chd=rs.getString("punishment.description");
string=string+" Number :"+pid+"\n"+" full name :"+sname+"\n"+" Types of punishment :"+ades+"\n"+" Time :"+set+"\n"+" Whether to take effect :"+ena+"\n"+" describe :"+chd+"\n"+"\n\n\n";
}
} catch (SQLException ex) {
ex.printStackTrace();
} finally {
DBUtil.CloseDB(rs, stm, conn);
}
xianshikuang.setText(string);
}
}
public class gonggao implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
String string="";
String id=studentid.getText();
Connection conn = DBUtil.getConnectDb();
String sql = "select id,time,person,context,studentid from students.notice where studentid='"+id+"' or studentid='000000'";
PreparedStatement stm = null;
ResultSet rs = null;
student stu=null;
try {
stm = conn.prepareStatement(sql);
rs = stm.executeQuery();
while(rs.next()){
String pid=rs.getString("id");
String time=rs.getString("time");
String person=rs.getString("person");
String context=rs.getString("context");
String st=rs.getString("studentid");
if("000000".equals(st)){
string=string+" Number :"+pid+"\n"+" Release time :"+time+"\n"+" Publisher :"+person+"\n"+" Publish content :"+context+"\n"+" Publishing objects : Mass hair "+"\n\n\n";
}else{
string=string+" Number :"+pid+"\n"+" Release time :"+time+"\n"+" Publisher :"+person+"\n"+" Publish content :"+context+"\n"+" Publishing objects : Private hair "+"\n\n\n";
}
}
} catch (SQLException ex) {
ex.printStackTrace();
} finally {
DBUtil.CloseDB(rs, stm, conn);
}
xianshikuang.setText(string);
}
}
public class stu implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
String string="";
String id=studentid.getText();
Connection conn = DBUtil.getConnectDb();
String sql = "select studentid,student.name,sex,class.name,class.monitor,department.name,birthday,native_place from student,class,department where student.class=class.id and student.department=department.id and studentid='"+id+"'";
PreparedStatement stm = null;
ResultSet rs = null;
student stu=null;
try {
stm = conn.prepareStatement(sql);
rs = stm.executeQuery();
while(rs.next()){
String pid=rs.getString("studentid");
String name=rs.getString("student.name");
String sex=rs.getString("sex");
String clas=rs.getString("class.name");
String monito=rs.getString("class.monitor");
String department=rs.getString("department.name");
String birthday=rs.getString("birthday");
String native_place=rs.getString("native_place");
string=string+" Student number :"+pid+"\n"+" full name :"+name+"\n"+" Gender :"+sex+"\n"+" class :"+clas+"\n"+" Monitor of the class :"+monito+"\n"+" departments :"+department+"\n"+" Birthday :"+birthday+"\n"+" The household registration :"+native_place+"\n"+"\n\n\n";
}
} catch (SQLException ex) {
ex.printStackTrace();
} finally {
DBUtil.CloseDB(rs, stm, conn);
}
xianshikuang.setText(string);
}
}
public class sst implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
String st=studentid.getText();
new xiugaigerxinxi(st);
}
}
public class xiu implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
String st=studentid.getText();
String paw=password.getText();
new xiugaimima(st,paw);
}
}
public class tui implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
}
public static void main(String[] args) {
student stu=new student("2005010523"," Zhouxinyu "," Woman ","369412","312589","2002-06-28"," Loudi City, Hunan Province ","123456",0," Developers have something to say " +"\n"+" This system can only meet the basic viewing function , It cannot be operated by the user too much , You can also modify your personal information , Users , The authority is naturally not as high as that of the administrator , So you want to get more permissions , Naturally, I will try my best to fight monsters and upgrade , Come and leave a message here to motivate yourself , It's hard to fill in the number of words , Let me say two more words , This function is purely a panel that looks like space ,, And my superb skills , Just add a little function , Hey , Hee hee , ha-ha , I am so crazy ! Do you have any complaints ?");
new student_main(stu);
}
}
Reward application code :
package com.yu.web.student;
import com.yu.pojo.student;
import com.yu.util.DBUtil;
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.border.LineBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.*;
import java.text.SimpleDateFormat;
import java.util.Date;
public class shengqingreward extends JFrame {
JLabel biaodan=new JLabel(" Scholarship application form ");
JLabel cao=new JLabel(" Scholarship level :");
JComboBox<String> caozuo=new JComboBox<>();
JLabel miaoshi=new JLabel(" describe :");
JTextArea miaoshutext=new JTextArea();
JButton chongzhi=new JButton(" Reset ");
JButton tijiao=new JButton(" Submit ");
JButton string=new JButton("");
SpringLayout springLayout=new SpringLayout();
public shengqingreward(String id){
super(" Scholarship application form ");
string.setText(id);
Container contentPane=getContentPane();
biaodan.setFont(new Font(" Regular script ",Font.PLAIN,25));
caozuo.addItem(" Special scholarship of the University ");
caozuo.addItem(" First class scholarship ");
caozuo.addItem(" Second class scholarship ");
caozuo.addItem(" Third class scholarship of the University ");
caozuo.addItem(" First class scholarship ");
caozuo.addItem(" Second class scholarship of the Department ");
caozuo.addItem(" Third class scholarship of the Department ");
caozuo.setSelectedIndex(0);
String cc=caozuo.getSelectedItem().toString().trim();
springLayout.putConstraint(SpringLayout.NORTH,biaodan,20,SpringLayout.NORTH,contentPane);
springLayout.putConstraint(SpringLayout.WEST,biaodan,200,SpringLayout.WEST,contentPane);
cao.setFont(new Font(" Regular script ",Font.PLAIN,20));
springLayout.putConstraint(SpringLayout.NORTH,cao,50,SpringLayout.NORTH,biaodan);
springLayout.putConstraint(SpringLayout.WEST,cao,100,SpringLayout.WEST,contentPane);
caozuo.setFont(new Font(" Regular script ",Font.PLAIN,20));
caozuo.setPreferredSize(new Dimension(200,25));
springLayout.putConstraint(SpringLayout.NORTH,caozuo,0,SpringLayout.NORTH,cao);
springLayout.putConstraint(SpringLayout.WEST,caozuo,20,SpringLayout.EAST,cao);
miaoshi.setFont(new Font(" Regular script ",Font.PLAIN,20));
springLayout.putConstraint(SpringLayout.NORTH,miaoshi,20,SpringLayout.SOUTH,cao);
springLayout.putConstraint(SpringLayout.WEST,miaoshi,0,SpringLayout.WEST,cao);
miaoshutext.setFont(new Font(" Regular script ",Font.PLAIN,20));
miaoshutext.setPreferredSize(new Dimension(350,150));
miaoshutext.setLineWrap(true);
springLayout.putConstraint(SpringLayout.NORTH,miaoshutext,0,SpringLayout.NORTH,miaoshi);
springLayout.putConstraint(SpringLayout.WEST,miaoshutext,20,SpringLayout.EAST,miaoshi);
Border border1=new LineBorder(Color.lightGray,2);
miaoshutext.setBorder(border1);
chongzhi.setFont(new Font(" Regular script ",Font.PLAIN,20));
tijiao.setFont(new Font(" Regular script ",Font.PLAIN,20));
chongzhi.setPreferredSize(new Dimension(80,30));
tijiao.setPreferredSize(new Dimension(80,30));
springLayout.putConstraint(SpringLayout.NORTH,chongzhi,20,SpringLayout.SOUTH,miaoshutext);
springLayout.putConstraint(SpringLayout.WEST,chongzhi,200,SpringLayout.WEST,contentPane);
springLayout.putConstraint(SpringLayout.NORTH,tijiao,0,SpringLayout.NORTH,chongzhi);
springLayout.putConstraint(SpringLayout.WEST,tijiao,50,SpringLayout.EAST,chongzhi);
chongzhi.addActionListener(new chongzhi());
tijiao.addActionListener(new tijiao());
contentPane.setLayout(springLayout);
contentPane.add(biaodan);
contentPane.add(cao);
contentPane.add(caozuo);
contentPane.add(miaoshi);
contentPane.add(miaoshutext);
contentPane.add(chongzhi);
contentPane.add(tijiao);
setSize(600,400);
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setResizable(false);
setVisible(true);
}
public class chongzhi implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
miaoshutext.setText("");
}
}
public class tijiao implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
String xue=string.getText();
String cc=caozuo.getSelectedItem().toString().trim();
int chan=0;
if(" Special scholarship of the University ".equals(cc)){
chan=0;
}else if(" First class scholarship ".equals(cc)){
chan=1;
}else if(" Second class scholarship ".equals(cc)){
chan=2;
}else if(" Third class scholarship of the University ".equals(cc)){
chan=3;
}else if(" First class scholarship ".equals(cc)){
chan=4;
}else if(" Second class scholarship of the Department ".equals(cc)){
chan=5;
}else if(" Third class scholarship of the Department ".equals(cc)){
chan=6;
}
int xu=1;
Connection conn = DBUtil.getConnectDb();
String sql1="select *from reward";
PreparedStatement stm = null;
ResultSet rs = null;
student stu=null;
try {
stm = conn.prepareStatement(sql1);
rs = stm.executeQuery();
while(rs.next()){
if(rs.getInt(1)>xu)
xu=rs.getInt(1);
}
} catch (SQLException ex) {
ex.printStackTrace();
} finally {
DBUtil.CloseDB(rs, stm, conn);
}
xu=xu+1;
Connection connn = DBUtil.getConnectDb();
SimpleDateFormat sdf=new SimpleDateFormat("YYYY-MM-dd");
String time= sdf.format(new Date());
String miao=miaoshutext.getText();
String sql = "insert into reward(id,studentid,levels,rec_time,description,states) values(?,?,?,?,?,?)";
PreparedStatement stms = null;
try {
stms = connn.prepareStatement(sql);
stms.setString(1, String.valueOf(xu));
stms.setString(2, xue);
stms.setInt(3, chan);
stms.setString(4, time);
stms.setString(5, miao);
stms.setInt(6, 0);
stms.executeUpdate();
} catch (SQLException ee) {
ee.printStackTrace();
}finally {
DBUtil.CloseDB(rs,stms, conn);
}
miaoshutext.setText("");
caozuo.setSelectedIndex(0);
}
}
public static void main(String[] args) {
new xuejishengqing("255");
}
}
Personal information modification :
package com.yu.web.student;
import com.yu.util.DBUtil;
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.border.LineBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.*;
public class xiugaigerxinxi extends JFrame {
JLabel biaodan=new JLabel(" Modify personal information ");
JLabel cao=new JLabel(" Birthday :");
JTextField caotext=new JTextField();
JLabel miaoshi=new JLabel(" The household registration :");
JTextField miaoshutext=new JTextField();
JButton chongzhi=new JButton(" Reset ");
JButton tijiao=new JButton(" Submit ");
JButton string=new JButton("");
SpringLayout springLayout=new SpringLayout();
public xiugaigerxinxi(String id){
super(" Modify personal information ");
string.setText(id);
Container contentPane=getContentPane();
biaodan.setFont(new Font(" Regular script ",Font.PLAIN,25));
springLayout.putConstraint(SpringLayout.NORTH,biaodan,20,SpringLayout.NORTH,contentPane);
springLayout.putConstraint(SpringLayout.WEST,biaodan,200,SpringLayout.WEST,contentPane);
cao.setFont(new Font(" Regular script ",Font.PLAIN,20));
springLayout.putConstraint(SpringLayout.NORTH,cao,50,SpringLayout.NORTH,biaodan);
springLayout.putConstraint(SpringLayout.WEST,cao,100,SpringLayout.WEST,contentPane);
caotext.setFont(new Font(" Regular script ",Font.PLAIN,20));
caotext.setPreferredSize(new Dimension(200,25));
springLayout.putConstraint(SpringLayout.NORTH,caotext,0,SpringLayout.NORTH,cao);
springLayout.putConstraint(SpringLayout.WEST,caotext,20,SpringLayout.EAST,cao);
miaoshi.setFont(new Font(" Regular script ",Font.PLAIN,20));
springLayout.putConstraint(SpringLayout.NORTH,miaoshi,20,SpringLayout.SOUTH,cao);
springLayout.putConstraint(SpringLayout.WEST,miaoshi,0,SpringLayout.WEST,cao);
miaoshutext.setFont(new Font(" Regular script ",Font.PLAIN,20));
miaoshutext.setPreferredSize(new Dimension(200,25));
springLayout.putConstraint(SpringLayout.NORTH,miaoshutext,0,SpringLayout.NORTH,miaoshi);
springLayout.putConstraint(SpringLayout.WEST,miaoshutext,20,SpringLayout.EAST,miaoshi);
Border border1=new LineBorder(Color.lightGray,2);
miaoshutext.setBorder(border1);
chongzhi.setFont(new Font(" Regular script ",Font.PLAIN,20));
tijiao.setFont(new Font(" Regular script ",Font.PLAIN,20));
chongzhi.setPreferredSize(new Dimension(80,30));
tijiao.setPreferredSize(new Dimension(80,30));
springLayout.putConstraint(SpringLayout.NORTH,chongzhi,20,SpringLayout.SOUTH,miaoshutext);
springLayout.putConstraint(SpringLayout.WEST,chongzhi,150,SpringLayout.WEST,contentPane);
springLayout.putConstraint(SpringLayout.NORTH,tijiao,0,SpringLayout.NORTH,chongzhi);
springLayout.putConstraint(SpringLayout.WEST,tijiao,50,SpringLayout.EAST,chongzhi);
chongzhi.addActionListener(new chongzhi());
tijiao.addActionListener(new tijiao());
contentPane.setLayout(springLayout);
contentPane.add(biaodan);
contentPane.add(cao);
contentPane.add(caotext);
contentPane.add(miaoshi);
contentPane.add(miaoshutext);
contentPane.add(chongzhi);
contentPane.add(tijiao);
setSize(600,400);
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setResizable(false);
setVisible(true);
}
public class chongzhi implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
caotext.setText("");
miaoshutext.setText("");
}
}
public class tijiao implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
String xue=string.getText();
String bir=caotext.getText();
String hu=miaoshutext.getText();
Connection connn = DBUtil.getConnectDb();
String sql = "update student set birthday='"+bir+"',native_place='"+hu+"' where studentid='"+xue+"'";
PreparedStatement stms = null;
ResultSet rs = null;
try {
stms = connn.prepareStatement(sql);
stms.executeUpdate();
} catch (SQLException ee) {
ee.printStackTrace();
}finally {
DBUtil.CloseDB(rs,stms, connn);
}
caotext.setText("");
miaoshutext.setText("");
}
}
public static void main(String[] args) {
new xiugaigerxinxi("255");
}
}
Change Password :
package com.yu.web.student;
import com.yu.util.DBUtil;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.*;
public class xiugaimima extends JFrame {
JLabel biaodan=new JLabel(" Change Password ");
JLabel cao=new JLabel(" Please enter the original password :");
JPasswordField caotext=new JPasswordField();
JLabel miaoshi=new JLabel(" Enter the original password again :");
JPasswordField miaoshutext=new JPasswordField();
JLabel caoo=new JLabel(" Please enter the new password :");
JPasswordField caotextt=new JPasswordField();
JButton chongzhi=new JButton(" Reset ");
JButton tijiao=new JButton(" Submit ");
JLabel tishi=new JLabel("");
JLabel passw=new JLabel("");
JButton string=new JButton("");
SpringLayout springLayout=new SpringLayout();
public xiugaimima(String id, String paw){
super(" Change Password ");
string.setText(id);
passw.setText(paw);
Container contentPane=getContentPane();
biaodan.setFont(new Font(" Regular script ",Font.PLAIN,25));
springLayout.putConstraint(SpringLayout.NORTH,biaodan,20,SpringLayout.NORTH,contentPane);
springLayout.putConstraint(SpringLayout.WEST,biaodan,200,SpringLayout.WEST,contentPane);
cao.setFont(new Font(" Regular script ",Font.PLAIN,20));
caoo.setFont(new Font(" Regular script ",Font.PLAIN,20));
springLayout.putConstraint(SpringLayout.NORTH,cao,50,SpringLayout.NORTH,biaodan);
springLayout.putConstraint(SpringLayout.WEST,cao,100,SpringLayout.WEST,contentPane);
caotext.setFont(new Font(" Regular script ",Font.PLAIN,20));
caotextt.setFont(new Font(" Regular script ",Font.PLAIN,20));
caotext.setPreferredSize(new Dimension(200,25));
caotextt.setPreferredSize(new Dimension(200,25));
springLayout.putConstraint(SpringLayout.NORTH,caotext,0,SpringLayout.NORTH,cao);
springLayout.putConstraint(SpringLayout.WEST,caotext,20,SpringLayout.EAST,cao);
miaoshi.setFont(new Font(" Regular script ",Font.PLAIN,20));
springLayout.putConstraint(SpringLayout.NORTH,miaoshi,20,SpringLayout.SOUTH,cao);
springLayout.putConstraint(SpringLayout.WEST,miaoshi,0,SpringLayout.WEST,cao);
miaoshutext.setFont(new Font(" Regular script ",Font.PLAIN,20));
miaoshutext.setPreferredSize(new Dimension(200,25));
springLayout.putConstraint(SpringLayout.NORTH,miaoshutext,0,SpringLayout.NORTH,miaoshi);
springLayout.putConstraint(SpringLayout.WEST,miaoshutext,20,SpringLayout.EAST,miaoshi);
springLayout.putConstraint(SpringLayout.NORTH,caoo,20,SpringLayout.SOUTH,miaoshi);
springLayout.putConstraint(SpringLayout.WEST,caoo,0,SpringLayout.WEST,miaoshi);
springLayout.putConstraint(SpringLayout.NORTH,caotextt,0,SpringLayout.NORTH,caoo);
springLayout.putConstraint(SpringLayout.WEST,caotextt,20,SpringLayout.EAST,caoo);
chongzhi.setFont(new Font(" Regular script ",Font.PLAIN,20));
tijiao.setFont(new Font(" Regular script ",Font.PLAIN,20));
tishi.setFont(new Font(" Regular script ",Font.PLAIN,20));
chongzhi.setPreferredSize(new Dimension(80,30));
tijiao.setPreferredSize(new Dimension(80,30));
springLayout.putConstraint(SpringLayout.NORTH,chongzhi,20,SpringLayout.SOUTH,caotextt);
springLayout.putConstraint(SpringLayout.WEST,chongzhi,150,SpringLayout.WEST,contentPane);
springLayout.putConstraint(SpringLayout.NORTH,tijiao,0,SpringLayout.NORTH,chongzhi);
springLayout.putConstraint(SpringLayout.WEST,tijiao,50,SpringLayout.EAST,chongzhi);
springLayout.putConstraint(SpringLayout.NORTH,tishi,10,SpringLayout.SOUTH,chongzhi);
springLayout.putConstraint(SpringLayout.WEST,tishi,0,SpringLayout.WEST,chongzhi);
tishi.setForeground(Color.RED);
chongzhi.addActionListener(new chongzhi());
tijiao.addActionListener(new tijiao());
contentPane.setLayout(springLayout);
contentPane.add(biaodan);
contentPane.add(cao);
contentPane.add(caotext);
contentPane.add(caoo);
contentPane.add(caotextt);
contentPane.add(miaoshi);
contentPane.add(miaoshutext);
contentPane.add(chongzhi);
contentPane.add(tijiao);
contentPane.add(tishi);
setSize(600,400);
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setResizable(false);
setVisible(true);
}
public class chongzhi implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
caotext.setText("");
miaoshutext.setText("");
caotextt.setText("");
}
}
public class tijiao implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
String xue=string.getText();
String password=passw.getText();
String yuan=caotext.getText();
String hou=caotextt.getText();
String zyuan=miaoshutext.getText();
if(yuan.length()==0||zyuan.length()==0||hou.length()==0){
tishi.setText(" The original password or new password is empty , Please fill in again ");
caotext.setText("");
miaoshutext.setText("");
caotextt.setText("");
}else if(!yuan.equals(zyuan)){
tishi.setText(" The original passwords entered twice are inconsistent , Please fill in again ");
caotext.setText("");
miaoshutext.setText("");
caotextt.setText("");
}else if(!password.equals(yuan)){
tishi.setText(" Original password input error ");
caotext.setText("");
miaoshutext.setText("");
caotextt.setText("");
}else{
Connection connn = DBUtil.getConnectDb();
String sql = "update student set password='"+hou+"' where studentid='"+xue+"'";
PreparedStatement stms = null;
ResultSet rs = null;
try {
stms = connn.prepareStatement(sql);
stms.executeUpdate();
} catch (SQLException ee) {
ee.printStackTrace();
}finally {
DBUtil.CloseDB(rs,stms, connn);
}
caotext.setText("");
miaoshutext.setText("");
caotextt.setText("");
tishi.setText("");
}
//
}
}
public static void main(String[] args) {
new xiugaimima("255","123456");
}
}
Student status application
package com.yu.web.student;
import com.yu.pojo.student;
import com.yu.util.DBUtil;
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.border.LineBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.*;
import java.text.SimpleDateFormat;
import java.util.Date;
public class xuejishengqing extends JFrame {
JLabel biaodan=new JLabel(" Application form for student status management ");
JLabel cao=new JLabel(" operation :");
JComboBox<String> caozuo=new JComboBox<>();
JLabel miaoshi=new JLabel(" describe :");
JTextArea miaoshutext=new JTextArea();
JButton chongzhi=new JButton(" Reset ");
JButton tijiao=new JButton(" Submit ");
JButton string=new JButton("");
SpringLayout springLayout=new SpringLayout();
public xuejishengqing(String id){
super(" Application form for student status management ");
string.setText(id);
Container contentPane=getContentPane();
biaodan.setFont(new Font(" Regular script ",Font.PLAIN,25));
caozuo.addItem(" transfer from one department to another ");
caozuo.addItem(" Suspension of school ");
caozuo.addItem(" Go back to school ");
caozuo.addItem(" Drop out of school ");
caozuo.addItem(" graduation ");
caozuo.setSelectedIndex(0);
String cc=caozuo.getSelectedItem().toString().trim();
springLayout.putConstraint(SpringLayout.NORTH,biaodan,20,SpringLayout.NORTH,contentPane);
springLayout.putConstraint(SpringLayout.WEST,biaodan,200,SpringLayout.WEST,contentPane);
cao.setFont(new Font(" Regular script ",Font.PLAIN,20));
springLayout.putConstraint(SpringLayout.NORTH,cao,50,SpringLayout.NORTH,biaodan);
springLayout.putConstraint(SpringLayout.WEST,cao,100,SpringLayout.WEST,contentPane);
caozuo.setFont(new Font(" Regular script ",Font.PLAIN,20));
caozuo.setPreferredSize(new Dimension(200,25));
springLayout.putConstraint(SpringLayout.NORTH,caozuo,0,SpringLayout.NORTH,cao);
springLayout.putConstraint(SpringLayout.WEST,caozuo,20,SpringLayout.EAST,cao);
miaoshi.setFont(new Font(" Regular script ",Font.PLAIN,20));
springLayout.putConstraint(SpringLayout.NORTH,miaoshi,20,SpringLayout.SOUTH,cao);
springLayout.putConstraint(SpringLayout.WEST,miaoshi,0,SpringLayout.WEST,cao);
miaoshutext.setFont(new Font(" Regular script ",Font.PLAIN,20));
miaoshutext.setPreferredSize(new Dimension(350,150));
miaoshutext.setLineWrap(true);
springLayout.putConstraint(SpringLayout.NORTH,miaoshutext,0,SpringLayout.NORTH,miaoshi);
springLayout.putConstraint(SpringLayout.WEST,miaoshutext,20,SpringLayout.EAST,miaoshi);
Border border1=new LineBorder(Color.lightGray,2);
miaoshutext.setBorder(border1);
chongzhi.setFont(new Font(" Regular script ",Font.PLAIN,20));
tijiao.setFont(new Font(" Regular script ",Font.PLAIN,20));
chongzhi.setPreferredSize(new Dimension(80,30));
tijiao.setPreferredSize(new Dimension(80,30));
springLayout.putConstraint(SpringLayout.NORTH,chongzhi,20,SpringLayout.SOUTH,miaoshutext);
springLayout.putConstraint(SpringLayout.WEST,chongzhi,200,SpringLayout.WEST,contentPane);
springLayout.putConstraint(SpringLayout.NORTH,tijiao,0,SpringLayout.NORTH,chongzhi);
springLayout.putConstraint(SpringLayout.WEST,tijiao,50,SpringLayout.EAST,chongzhi);
chongzhi.addActionListener(new chongzhi());
tijiao.addActionListener(new tijiao());
contentPane.setLayout(springLayout);
contentPane.add(biaodan);
contentPane.add(cao);
contentPane.add(caozuo);
contentPane.add(miaoshi);
contentPane.add(miaoshutext);
contentPane.add(chongzhi);
contentPane.add(tijiao);
setSize(600,400);
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setResizable(false);
setVisible(true);
}
public class chongzhi implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
miaoshutext.setText("");
}
}
public class tijiao implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
String xue=string.getText();
String cc=caozuo.getSelectedItem().toString().trim();
int chan=0;
if(" transfer from one department to another ".equals(cc)){
chan=0;
}else if(" Suspension of school ".equals(cc)){
chan=1;
}else if(" Go back to school ".equals(cc)){
chan=2;
}else if(" Drop out of school ".equals(cc)){
chan=3;
}else if(" graduation ".equals(cc)){
chan=4;
}
int xu=1;
Connection conn = DBUtil.getConnectDb();
String sql1="select *from changes";
PreparedStatement stm = null;
ResultSet rs = null;
student stu=null;
try {
stm = conn.prepareStatement(sql1);
rs = stm.executeQuery();
while(rs.next()){
if(rs.getInt(1)>xu)
xu=rs.getInt(1);
}
} catch (SQLException ex) {
ex.printStackTrace();
} finally {
DBUtil.CloseDB(rs, stm, conn);
}
xu=xu+1;
Connection connn = DBUtil.getConnectDb();
SimpleDateFormat sdf=new SimpleDateFormat("YYYY-MM-dd");
String time= sdf.format(new Date());
String miao=miaoshutext.getText();
String sql = "insert into changes(id,studentid,changes,rec_time,description,states) values(?,?,?,?,?,?)";
PreparedStatement stms = null;
try {
stms = connn.prepareStatement(sql);
stms.setString(1, String.valueOf(xu));
stms.setString(2, xue);
stms.setInt(3, chan);
stms.setString(4, time);
stms.setString(5, miao);
stms.setInt(6, 0);
stms.executeUpdate();
} catch (SQLException ee) {
ee.printStackTrace();
}finally {
DBUtil.CloseDB(rs,stms, conn);
}
miaoshutext.setText("");
caozuo.setSelectedIndex(0);
}
}
public static void main(String[] args) {
new xuejishengqing("255");
}
}
Administrator main interface :
The administrator main interface is also divided into three modules , Only the central module is different , Because it shows the information of all students , So you need to open a new page when displaying the specific content , So the main page is only used to display functions , So for beauty , I'm interested in the middle panel JPanel Our layout adopts FlowLayout Layout , This adds six of the same size inside JPanel panel , The intermediate modules can be filled evenly .
For each small JPanel panel , use SpringLayout Layout , The component has only one button , And a text field , The text field mainly introduces the functions of buttons , The main thing is that the filling panel makes the page look beautiful and magnificent .
Six buttons : Student management 、 Student status management 、 Reward management 、 Punishment management 、 Announcement management 、 Personal information management , It corresponds to the six functions of the administrator , Because the realization of each function is similar , So just one of them .
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.border.LineBorder;
import com.yu.web.admin.chufaguanli.chufaguanli;
import com.yu.web.admin.gerenxinxiguanli.gerenxinxiguanli;
import com.yu.web.admin.gonggaoguanli.gonggaoguanli;
import com.yu.web.admin.jiangliguanli.jiangliguanli;
import com.yu.web.admin.xuejiguanli.xuejiguanli;
import com.yu.web.admin.xueshengguanli.xueshengguanli;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class admin_main extends JFrame{
JLabel title=new JLabel(" Welcome to the student management system ");
JLabel huanying=new JLabel("");
JLabel jieshao=new JLabel(" The main function ");
JButton xuesheng=new JButton(" Student management ");
JButton changes=new JButton(" Student status management ");
JButton reward=new JButton(" Reward management ");
JButton punish=new JButton(" Punishment management ");
JButton student=new JButton(" Personal information ");
JButton gonggao=new JButton(" Announcement management ");
JTextArea xueshengtext=new JTextArea(" Function is introduced "+"\n"+" Inquire about : You can view all student information , You can also view and query student information ."+"\n"+" increase : Add students , It is mainly the freshmen who enter the school , It is necessary to set the main information of students ."+"\n"+" modify : The main information of students can be modified , Mainly used for shift change , transfer from one department to another ."+"\n"+" Delete : Delete students , Mainly used for wrong operation .");
JTextArea changestext=new JTextArea(" Function is introduced "+"\n"+" Inquire about : You can view the processed , You can also see the students' new applications ."+"\n"+" increase : It mainly manages the transfer of students , Suspension of school , Go back to school , Drop out of school , graduation ."+"\n"+" modify : Modify student status management records , It is mainly to approve the modification of the student's application ."+"\n"+" Delete : Delete student status management records , Mainly used for wrong operation .");
JTextArea rewardtext=new JTextArea(" Function is introduced "+"\n"+" Inquire about : You can view the processed , You can also see the new application "+"\n"+" increase : It mainly manages the Scholarship Selection of students , There are special scholarships , First class scholarship , Second class scholarship , Third class scholarship of the University , First class scholarship , Second class scholarship of the Department , Third class scholarship of the Department ."+"\n"+" modify : Modify the reward management record , It is mainly to approve the modification of the student's application ."+"\n"+" Delete : Delete reward management record , Mainly used for wrong operation .");
JTextArea punishtext=new JTextArea(" Function is introduced "+"\n"+" Inquire about : You can view the penalties that are also published , You can also query the punishment of specific students according to the student number "+"\n"+" increase : It mainly punishes the students who violate the rules , Especially in the final exam ."+"\n"+" modify : Modify the status of the penalty , There are two main states , take effect , Not in force ."+"\n"+" Delete : Delete punishment management record , Mainly used for wrong operation or cancellation of punishment .");
JTextArea studenttext=new JTextArea(" Function is introduced "+"\n"+" Inquire about : You can view the basic personal information of the administrator , user name , Colleges and departments "+"\n"+" Modify personal information : The administrator can modify the student ID , Because the student number is the primary key , Some other foreign key properties also need to satisfy constraints ."+"\n"+" Change Password : The administrator can change the password after entering the correct original password twice ."+"\n"+" sign out : The main thing is to exit the whole system safely .");
JTextArea gonggaoText=new JTextArea(" Function is introduced "+"\n"+" Inquire about : You can view the published announcements "+"\n"+" increase : For publishing announcements , It can be sent in groups , It can also be sent privately to a student , Particular attention : Mass sending will send the... Of the object id Set to 000000, The private issue is set to specify the student id "+"\n"+" modify : Modify bulletin , Mainly to modify the contents of the announcement ."+"\n"+" Delete : Delete announcement , Mainly dealing with long-standing announcements , Or delete the announcements privately sent to students .");
JButton chongzhi=new JButton(" Reset ");
JButton liuyan=new JButton(" modify ");
// Used to save the user information of the current page
JLabel studentid=new JLabel("");
JLabel name=new JLabel("");
JLabel sex=new JLabel("");
JLabel clas=new JLabel("");
JLabel department=new JLabel("");
JLabel birthday=new JLabel("");
JLabel native_place=new JLabel("");
JLabel password=new JLabel("");
JTextArea tianchong=new JTextArea();
SpringLayout springLayout=new SpringLayout();
JPanel jPanel1=new JPanel();
JPanel jPanel2=new JPanel(springLayout);
JPanel jPanel3=new JPanel(new FlowLayout());
JPanel jPanel4=new JPanel();
JPanel jPanel5=new JPanel(springLayout);
JPanel jPanel6=new JPanel(springLayout);
JPanel jPanel7=new JPanel(springLayout);
JPanel jPanel8=new JPanel(springLayout);
JPanel jPanel9=new JPanel(springLayout);
JPanel jPanel10=new JPanel(springLayout);
public admin_main(){
}
public admin_main(student s){
super(" Administrator login main page ");
JPanel root=new JPanel();
this.setContentPane(root);
BorderLayout borderLayout=new BorderLayout();
root.setLayout(borderLayout);
student stu=s;
huanying.setText(s.getName());
// Save current user information
studentid.setText(s.getStudentid());
name.setText(s.getName());
sex.setText(s.getSex());
clas.setText(s.getClas());
department.setText(s.getDepartment());
birthday.setText(s.getBirthday());
native_place.setText(s.getNative_place());
password.setText(s.getPassword());
// Set the font
title.setFont(new Font(" Chinese Xingkai ",Font.PLAIN,100));
huanying.setFont(new Font(" Chinese Xingkai ",Font.PLAIN,100));
jieshao.setFont(new Font(" Song style ",Font.PLAIN,35));
tianchong.setFont(new Font(" Regular script _GB2312",Font.PLAIN,20));
Font font1=new Font(" Regular script ",Font.PLAIN,20);
Font font3=new Font(" Chinese regular script ",Font.PLAIN,20);
changes.setFont(font1);
reward.setFont(font1);
punish.setFont(font1);
student.setFont(font1);
gonggao.setFont(font1);
xuesheng.setFont(font1);
liuyan.setFont(font1);
chongzhi.setFont(font1);
xuesheng.setFont(font1);
xueshengtext.setFont(font3);
changestext.setFont(font3);
rewardtext.setFont(font3);
punishtext.setFont(font3);
studenttext.setFont(font3);
gonggaoText.setFont(font3);
xueshengtext.setFont(font3);
// The input box sets the size
chongzhi.setPreferredSize(new Dimension(100,50));
liuyan.setPreferredSize(new Dimension(100,50));
huanying.setPreferredSize(new Dimension(500,200));
jPanel2.setPreferredSize(new Dimension(400,300));
tianchong.setPreferredSize(new Dimension(350,350));
Dimension di1=new Dimension(150,50);
Dimension di2=new Dimension(470,420);
Dimension di3=new Dimension(410,250);
changes.setPreferredSize(di1);
reward.setPreferredSize(di1);
punish.setPreferredSize(di1);
student.setPreferredSize(di1);
gonggao.setPreferredSize(di1);
xuesheng.setPreferredSize(di1);
jPanel5.setPreferredSize(di2);
jPanel6.setPreferredSize(di2);
jPanel7.setPreferredSize(di2);
jPanel8.setPreferredSize(di2);
jPanel9.setPreferredSize(di2);
jPanel10.setPreferredSize(di2);
changestext.setPreferredSize(di3);
rewardtext.setPreferredSize(di3);
punishtext.setPreferredSize(di3);
studenttext.setPreferredSize(di3);
gonggaoText.setPreferredSize(di3);
xueshengtext.setPreferredSize(di3);
// Text field settings
xueshengtext.setLineWrap(true);
changestext.setLineWrap(true);
rewardtext.setLineWrap(true);
punishtext.setLineWrap(true);
gonggaoText.setLineWrap(true);
studenttext.setLineWrap(true);
tianchong.setForeground(Color.BLUE);
tianchong.setLineWrap(true);
tianchong.setText(s.getLiuyan());
jPanel1.add(title);
jPanel2.add(huanying);
jPanel2.add(tianchong);
jPanel2.add(liuyan);
jPanel2.add(chongzhi);
jPanel3.add(jPanel5);
jPanel3.add(jPanel6);
jPanel3.add(jPanel7);
jPanel3.add(jPanel8);
jPanel3.add(jPanel9);
jPanel3.add(jPanel10);
jPanel5.add(xuesheng);
jPanel5.add(xueshengtext);
jPanel6.add(changes);
jPanel6.add(changestext);
jPanel7.add(reward);
jPanel7.add(rewardtext);
jPanel8.add(punish);
jPanel8.add(punishtext);
jPanel9.add(gonggao);
jPanel9.add(gonggaoText);
jPanel10.add(student);
jPanel10.add(studenttext);
// Positioning assembly
springLayout.putConstraint(SpringLayout.NORTH,jieshao,20,SpringLayout.NORTH,jPanel3);
springLayout.putConstraint(SpringLayout.WEST,jieshao,100,SpringLayout.WEST,jPanel3);
springLayout.putConstraint(SpringLayout.NORTH,xuesheng,50,SpringLayout.NORTH,jPanel5);
springLayout.putConstraint(SpringLayout.WEST,xuesheng,150,SpringLayout.WEST,jPanel5);
springLayout.putConstraint(SpringLayout.NORTH,xueshengtext,20,SpringLayout.SOUTH,xuesheng);
springLayout.putConstraint(SpringLayout.WEST,xueshengtext,30,SpringLayout.WEST,jPanel5);
springLayout.putConstraint(SpringLayout.NORTH,changes,50,SpringLayout.NORTH,jPanel6);
springLayout.putConstraint(SpringLayout.WEST,changes,150,SpringLayout.WEST,jPanel6);
springLayout.putConstraint(SpringLayout.NORTH,changestext,20,SpringLayout.SOUTH,changes);
springLayout.putConstraint(SpringLayout.WEST,changestext,30,SpringLayout.WEST,jPanel6);
springLayout.putConstraint(SpringLayout.NORTH,reward,50,SpringLayout.NORTH,jPanel7);
springLayout.putConstraint(SpringLayout.WEST,reward,150,SpringLayout.WEST,jPanel7);
springLayout.putConstraint(SpringLayout.NORTH,rewardtext,20,SpringLayout.SOUTH,reward);
springLayout.putConstraint(SpringLayout.WEST,rewardtext,30,SpringLayout.WEST,jPanel7);
springLayout.putConstraint(SpringLayout.NORTH,punish,50,SpringLayout.NORTH,jPanel8);
springLayout.putConstraint(SpringLayout.WEST,punish,150,SpringLayout.WEST,jPanel8);
springLayout.putConstraint(SpringLayout.NORTH,punishtext,20,SpringLayout.SOUTH,punish);
springLayout.putConstraint(SpringLayout.WEST,punishtext,30,SpringLayout.WEST,jPanel8);
springLayout.putConstraint(SpringLayout.NORTH,gonggao,50,SpringLayout.NORTH,jPanel9);
springLayout.putConstraint(SpringLayout.WEST,gonggao,150,SpringLayout.WEST,jPanel9);
springLayout.putConstraint(SpringLayout.NORTH,gonggaoText,20,SpringLayout.SOUTH,gonggao);
springLayout.putConstraint(SpringLayout.WEST,gonggaoText,30,SpringLayout.WEST,jPanel9);
springLayout.putConstraint(SpringLayout.NORTH,student,50,SpringLayout.NORTH,jPanel10);
springLayout.putConstraint(SpringLayout.WEST,student,150,SpringLayout.WEST,jPanel10);
springLayout.putConstraint(SpringLayout.NORTH,studenttext,20,SpringLayout.SOUTH,student);
springLayout.putConstraint(SpringLayout.WEST,studenttext,30,SpringLayout.WEST,jPanel10);
springLayout.putConstraint(SpringLayout.NORTH,huanying,20,SpringLayout.NORTH,jPanel2);
springLayout.putConstraint(SpringLayout.WEST,huanying,50,SpringLayout.WEST,jPanel2);
springLayout.putConstraint(SpringLayout.NORTH,tianchong,300,SpringLayout.NORTH,jPanel2);
springLayout.putConstraint(SpringLayout.WEST,tianchong,25,SpringLayout.WEST,jPanel2);
springLayout.putConstraint(SpringLayout.NORTH,chongzhi,20,SpringLayout.SOUTH,tianchong);
springLayout.putConstraint(SpringLayout.WEST,chongzhi,50,SpringLayout.WEST,tianchong);
springLayout.putConstraint(SpringLayout.NORTH,liuyan,0,SpringLayout.NORTH,chongzhi);
springLayout.putConstraint(SpringLayout.WEST,liuyan,20,SpringLayout.EAST,chongzhi);
// jPanel6.setBorder(border1); Define borders
Border border1=new LineBorder(Color.lightGray,2);
jPanel1.setBorder(border1);
jPanel2.setBorder(border1);
jPanel4.setBorder(border1);
jPanel5.setBorder(border1);
jPanel6.setBorder(border1);
jPanel7.setBorder(border1);
jPanel8.setBorder(border1);
jPanel9.setBorder(border1);
jPanel10.setBorder(border1);
root.add(jPanel1,BorderLayout.NORTH);
root.add(jPanel2,BorderLayout.WEST);
root.add(jPanel3,BorderLayout.CENTER);
root.add(jPanel4,BorderLayout.SOUTH);
// Monitoring events
chongzhi.addActionListener(new chongzhi());
liuyan.addActionListener(new liuyan());
xuesheng.addActionListener(new xueshengg());
changes.addActionListener(new changesListener());
reward.addActionListener(new jiangliListener());
punish.addActionListener(new chufaListener());
gonggao.addActionListener(new gonggaoListener());
student.addActionListener(new studentListener());
// JButton student=new JButton(" Personal information ");
Dimension screenSize=Toolkit.getDefaultToolkit().getScreenSize();
setSize(screenSize.width,screenSize.height);
setLocationRelativeTo(null);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setResizable(false);
setVisible(true);
}
public class chongzhi implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
tianchong.setText("");
}
}
public class liuyan implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
String string=tianchong.getText();
String id=studentid.getText();
login login=new login();
login.xiugai(string,id);
}
}
public class xueshengg implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
new xueshengguanli();
}
}
public class changesListener implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
new xuejiguanli();
}
}
public class jiangliListener implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
new jiangliguanli();
}
}
public class chufaListener implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
new chufaguanli();
}
}
public class gonggaoListener implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
new gonggaoguanli();
}
}
public class studentListener implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
new gerenxinxiguanli(studentid.getText());
}
}
public static void main(String[] args) {
student stu=new student("admin"," Administrators "," male ","","312000","1995-08-08"," Xiangtan City, Hunan Province ","123456",1," Dear Administrator :\n" +
" Hello! , Administrators , The administrator naturally wants to manage , But you are not managing this system , After all, your functions are also set by this system , Nor is it a management database , That's the database administrator's business , You need to manage students , The main object of responsibility is the students , It is just the basic operation of student information , But one thing to remind you is , Every time you press the submit button, be sure to carefully check the information you fill in , Because I didn't set the pop-up confirmation box , Hey .");
new admin_main(stu);
}
}
Student management :
The main panel is FlowLayout Layout , It is mainly divided into two parts , One is used to display the operation in the north , One is central , It's a wheel panel JTable Components , There are two reasons , One is to put the JTable The meter can be displayed on the roller panel , The other is that even if there are multiple records , You can see it through the scroll panel , There is no need to add a complex previous page , The next page .
JTable Introduce : There is a new component ,JTable, First of all, you must set the header , The header passes
JTableHeader tableHeader=jtable.getTableHeader();// Set the header
tableHeader.setFont(new Font(null,Font.BOLD,20));
tableHeader.setForeground(Color.RED);
This part of the code is the setting of the completed table header .
The setting of table body is simple , Use the table name directly . The method name implements .
jtable.setForeground(Color.black);// Table body
jtable.setGridColor(Color.BLACK);// Form line
jtable.setFont(new Font(null,Font.PLAIN,16));
jtable.setRowHei // Row height jtable.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);// Set multi row selection
Before introducing each row and column, I will first introduce how to set the table model . The declaration form is new JTable( The model name ), For the model , It's next , The following functions :
DefaultTableModel tableModel=new DefaultTableModel();
Adding data to the table also requires adding... To the model , And how to get data from the database , Every row in the table , We can define one Vector number=new Vector<>(); object , Then by querying the database , For each tuple, it is encapsulated into a number object , The whole table is equivalent to a two-dimensional array , We define it as Vector<Vector> data=new Vector<>(); object , And then through data.addElement(number); Method adds every tuple to it , Last call
tableModel.setDataVector(data,Columns); Method adds the data to the model , The latter parameter encapsulates the table header Vector() object .
Many say , Because each function needs to be refreshed after implementation , So this part can be extracted and encapsulated into a method , Convenient to call .
Regression how to set the table column needs to introduce a new class ;
class StudentCellRender extends DefaultTableCellRenderer{
@Override // Call... Before each column of each row is displayed
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
}
}
This function is used to set the table columns , You can set the text to be centered .
The basic attribute settings of the table are finished .
Next, let's talk about the functions , Additions and deletions .
package com.yu.web.admin.xueshengguanli;
import com.yu.pojo.student;
import com.yu.util.DBUtil;
import com.yu.web.admin.xueshengguanli.banjiguanli.banjiguanli;
import com.yu.web.admin.xueshengguanli.yuanxiguanli.yuanxiguanli;
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.border.LineBorder;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.JTableHeader;
import javax.swing.table.TableColumn;
import java.awt.*;
import java.awt.event.*;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;
public class xueshengguanli extends JFrame {
JLabel tianxiexuehao=new JLabel(" Please enter the complete student number :");
JButton ban=new JButton(" Class management ");
JButton yuan=new JButton(" Department management ");
JButton zeng=new JButton(" increase ");
JButton xiu=new JButton(" modify ");
JButton cha=new JButton(" Inquire about ");
JButton shan=new JButton(" Delete ");
JLabel tishi=new JLabel("");
JLabel kong1=new JLabel(" ");
JLabel kong2=new JLabel(" ");
JLabel kong3=new JLabel(" ");
JLabel kong4=new JLabel(" ");
JTextField xiutext=new JTextField();
JTextField chatext=new JTextField();
JTable jtable=new JTable();
DefaultTableModel tableModel=new DefaultTableModel();
JPanel northPanel=new JPanel(new FlowLayout(FlowLayout.LEFT));
public xueshengguanli() {
super(" Student management page ");
// Add panel
BorderLayout borderLayout=new BorderLayout();
JPanel root=new JPanel();
this.setContentPane(root);
root.setLayout(borderLayout);
JScrollPane jScrollPane=new JScrollPane(jtable);
root.add(northPanel,BorderLayout.NORTH);
root.add(jScrollPane,BorderLayout.CENTER);
// Add components
northPanel.add(kong1);
northPanel.add(zeng);
northPanel.add(kong2);
northPanel.add(tianxiexuehao);
northPanel.add(xiutext);
northPanel.add(xiu);
northPanel.add(shan);
northPanel.add(tishi);
northPanel.add(chatext);
northPanel.add(cha);
northPanel.add(kong4);
northPanel.add(ban);
northPanel.add(yuan);
// Component settings
zeng.setFont(new Font(" Chinese regular script ",Font.BOLD,15));
ban.setFont(new Font(" Chinese regular script ",Font.BOLD,15));
yuan.setFont(new Font(" Chinese regular script ",Font.BOLD,15));
xiu.setFont(new Font(" Chinese regular script ",Font.BOLD,15));
cha.setFont(new Font(" Chinese regular script ",Font.BOLD,15));
shan.setFont(new Font(" Chinese regular script ",Font.BOLD,15));
tishi.setFont(new Font(" Chinese regular script ",Font.BOLD,15));
tishi.setForeground(Color.RED);
tianxiexuehao.setFont(new Font(" Chinese regular script ",Font.PLAIN,20));
xiutext.setFont(new Font(" Chinese regular script ",Font.PLAIN,20));
chatext.setFont(new Font(" Chinese regular script ",Font.PLAIN,20));
xiutext.setPreferredSize(new Dimension(150,30));
chatext.setPreferredSize(new Dimension(300,30));
// Define borders
Border border1=new LineBorder(Color.lightGray,2);
northPanel.setBorder(border1);
// Show records
reloadTable();
jtable.setModel(tableModel);
jtable.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
int row=jtable.getSelectedRow();
String value= (String) jtable.getValueAt(row,1);
xiutext.setText(value);
}
});
String[] str = new String[10];
jtable.addMouseListener(new MouseAdapter() {
@Override
public void mouseReleased(MouseEvent e) {
int[] row=jtable.getSelectedRows();
for(int i=0;i<row.length;i++){
String value= (String) jtable.getValueAt(row[i],1);
str[i]=value;
}
}
});
jtable.addKeyListener(new KeyListener() {
@Override
public void keyTyped(KeyEvent e) {
}
@Override
public void keyPressed(KeyEvent e) {
for(int i=0;i<str.length;i++){
String id= str[i];
Connection conn1 = DBUtil.getConnectDb();
String sql1="delete from student where studentid='"+id+"'";
PreparedStatement stm1 = null;
ResultSet rs1 = null;
try {
stm1 = conn1.prepareStatement(sql1);
stm1.executeUpdate();
} catch (SQLException ex1) {
ex1.printStackTrace();
} finally {
DBUtil.CloseDB(rs1, stm1, conn1);
}
}
reloadTable();
}
@Override
public void keyReleased(KeyEvent e) {
}
});
// Set up the form
JTableHeader tableHeader=jtable.getTableHeader();// Set the header
tableHeader.setFont(new Font(null,Font.BOLD,20));
tableHeader.setForeground(Color.RED);
jtable.setFont(new Font(null,Font.PLAIN,16));
jtable.setForeground(Color.black);// Table body
jtable.setGridColor(Color.BLACK);// Form line
jtable.setRowHeight(30);// Row height
jtable.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);// Set multi row selection
// Set table columns
StudentCellRender render=new StudentCellRender();
Vector<String> Columns=new Vector<>();
Columns.addElement(" Serial number ");
Columns.addElement(" Student number ");
Columns.addElement(" full name ");
Columns.addElement(" Gender ");
Columns.addElement(" class ");
Columns.addElement(" departments ");
Columns.addElement(" Birthday ");
Columns.addElement(" The household registration ");
for(int j=0;j<Columns.size();j++)
{
TableColumn column=jtable.getColumn(Columns.get(j));
column.setCellRenderer(render);
}
// Monitoring events
cha.addActionListener(new chaxunListener());
ban.addActionListener(new banjiListener());
yuan.addActionListener(new yuanxiListener());
zeng.addActionListener(new zengjiaListener());
xiu.addActionListener(new xiugaiListener());
shan.addActionListener(new shanchuListener());
Dimension screenSize=Toolkit.getDefaultToolkit().getScreenSize();
setSize(screenSize.width,screenSize.height);
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setResizable(false);
setVisible(true);
}
class StudentCellRender extends DefaultTableCellRenderer{
@Override // Call... Before each column of each row is displayed
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
}
}
public void reloadTable(){
String string=chatext.getText();
Connection conn1 = DBUtil.getConnectDb();
String sql1;
int i=0;
if("".equals(string)){
sql1 = "select studentid,student.name,sex,class.name,department.name,birthday,native_place from student,class,department where state=0 and student.class=class.id and department.id=student.department ";
}else{
sql1="select studentid,student.name,sex,class.name,department.name,birthday,native_place from student,class,department where state=0 and student.class=class.id and department.id=student.department and (studentid like '%" + string + "%'" + " or student.name like '%" + string + "%'" +
" or student.name like '%" + string + "%'"+"or class.name like '%"+string+"%'"+"or department.name like '%"+string+"%'" + "or native_place like '%"+string+"%'" +"or birthday like '%"+string+"%'" +" or sex like '%" + string + "%') ";
}
PreparedStatement stm1 = null;
ResultSet rs1 = null;
student stu1=null;
int j=0;
Vector<Vector<Object>> data=new Vector<>();
try {
stm1 = conn1.prepareStatement(sql1);
rs1 = stm1.executeQuery();
while(rs1.next()){
j++;
Vector<Object> number1=new Vector<>();
i++;
String id=rs1.getString("studentid");
String studentname=rs1.getString("student.name");
String sex=rs1.getString("sex");
String clasname=rs1.getString("class.name");
String departmentname=rs1.getString("department.name");
String birthday=rs1.getString("birthday");
String native_place=rs1.getString("native_place");
number1.addElement(i);
number1.addElement(id);
number1.addElement(studentname);
number1.addElement(sex);
number1.addElement(clasname);
number1.addElement(departmentname);
number1.addElement(birthday);
number1.addElement(native_place);
data.addElement(number1);
}
} catch (SQLException ex1) {
ex1.printStackTrace();
} finally {
DBUtil.CloseDB(rs1, stm1, conn1);
}
Vector<String> Columns=new Vector<>();
Columns.addElement(" Serial number ");
Columns.addElement(" Student number ");
Columns.addElement(" full name ");
Columns.addElement(" Gender ");
Columns.addElement(" class ");
Columns.addElement(" departments ");
Columns.addElement(" Birthday ");
Columns.addElement(" The household registration ");
tableModel.setDataVector(data,Columns);
}
public class chaxunListener implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
reloadTable();
}
}
public class banjiListener implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
new banjiguanli();
}
}
public class yuanxiListener implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
new yuanxiguanli();
}
}
public class zengjiaListener implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
new tianjiaxuesheng();
reloadTable();
}
}
public class xiugaiListener implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
int i;
String id=xiutext.getText();
String na=null;
String se=null;
String cl=null;
String de=null;
String bi=null;
String nat=null;
String pa=null;
String liu=null;
int st=0;
Connection conn = DBUtil.getConnectDb();
String sql="select studentid,student.name,sex,class.name,department.name,birthday,native_place,password,state,liuyan from student,class,department where class.id=student.class and department.id=student.department and studentid='"+id+"'";
PreparedStatement stm = null;
ResultSet rs = null;
int flag=0;
try {
stm = conn.prepareStatement(sql);
System.out.println(sql);
rs = stm.executeQuery();
while(rs.next()){
flag=1;
na= rs.getString(2);
se= rs.getString(3);
cl= rs.getString(4);
de= rs.getString(5);
bi= rs.getString(6);
nat= rs.getString(7);
pa= rs.getString(8);
st= rs.getInt(9);
liu=rs.getString(10);
}
} catch (SQLException ex) {
ex.printStackTrace();
} finally {
DBUtil.CloseDB(rs, stm, conn);
}
if(flag==0){
tishi.setText(" The modified student ID does not exist , Please fill in again ");
xiutext.setText("");
}else{
new xiugaixuesheng(id,na,se,cl,de,bi,nat,pa,st,liu);
reloadTable();
}
}
}
public class shanchuListener implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
String id=xiutext.getText();
Connection conn1 = DBUtil.getConnectDb();
String sql1="delete from student where studentid='"+id+"'";
PreparedStatement stm1 = null;
ResultSet rs1 = null;
try {
stm1 = conn1.prepareStatement(sql1);
stm1.executeUpdate();
} catch (SQLException ex1) {
ex1.printStackTrace();
} finally {
DBUtil.CloseDB(rs1, stm1, conn1);
}
tishi.setText(" Delete student success !");
reloadTable();
}
}
public static void main(String[] args) {
new xueshengguanli();
}
}
Add students : Click the button and a new page will appear , It is a form for entering basic information , Administrator input information , Click Submit button , The data is passed by the service layer through the component name .getText() Method to get , Then you need to check whether it is not empty , Whether the primary key student ID has been used , By executing insert statements on connecting to the database , It is equivalent to adding students successfully .
Revise students : To modify a student, you need to enter the primary attribute student number , It's a little inconvenient to input every time you modify , So a small function is added here , By clicking a row in the table, you can obtain the attribute value of the student ID attribute of that row , By adding a mouse click event to the table , Get this line through the method , When you navigate to this column , The code is as follows :
jtable.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
int row=jtable.getSelectedRow();// Get the clicked line
String value= (String) jtable.getValueAt(row,1);// Get the attribute value of the attribute of the row
xiutext.setText(value);// Set the attribute value in the text field where the student number needs to be entered
}
});
Delete function : There are convenient ways to modify them , How can deletion not , Select a multi line keyboard and click Delete to complete the deletion function , The principle of implementation is , Save the student ID clicked by the mouse in an array , Then add a keyboard event , When you click the delete key, you will call the database to delete the student numbers stored in the array in turn .
Query function : Added to the data display , Get the string in the query box first , If it is blank, all information will be queried , If it is not empty, use fuzzy query .
Other features , For student status and rewards , You can view the user's application , Then modify the status , Approve or reject , For announcements, you can send them in groups or privately , The specific student ID is stored in the private database , Mass sending saves “000000”.
Add student :
package com.yu.web.admin.xueshengguanli;
import com.yu.util.DBUtil;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class tianjiaxuesheng extends JFrame {
JLabel biaoti=new JLabel(" Add student form ");
JLabel studentid=new JLabel(" Student number :");
JTextField studentidtext=new JTextField();
JLabel name=new JLabel(" full name :");
JTextField nametext=new JTextField();
JLabel sex=new JLabel(" Gender :");
JComboBox<String> sextext=new JComboBox<>();
JLabel banji=new JLabel(" class :");
JComboBox<String> banjitext=new JComboBox<>();
JLabel yuanxi=new JLabel(" departments :");
JComboBox<String> yuanxitext=new JComboBox<>();
JButton chongzhi=new JButton(" Reset ");
JButton tijiao=new JButton(" Submit ");
JLabel jieguo=new JLabel("");
public tianjiaxuesheng(){
super(" Add students ");
Container container=getContentPane();
SpringLayout springLayout=new SpringLayout();
container.setLayout(springLayout);
container.add(banji);
container.add(sex);
container.add(biaoti);
container.add(studentid);
container.add(studentidtext);
container.add(name);
container.add(nametext);
container.add(sextext);
container.add(banjitext);
container.add(yuanxi);
container.add(yuanxitext);
container.add(chongzhi);
container.add(tijiao);
container.add(jieguo);
biaoti.setFont(new Font(" Regular script ",Font.PLAIN,25));
banji.setFont(new Font(" Regular script ",Font.PLAIN,20));
sex.setFont(new Font(" Regular script ",Font.PLAIN,20));
studentid.setFont(new Font(" Regular script ",Font.PLAIN,20));
studentidtext.setFont(new Font(" Regular script ",Font.PLAIN,20));
name.setFont(new Font(" Regular script ",Font.PLAIN,20));
nametext.setFont(new Font(" Regular script ",Font.PLAIN,20));
sextext.setFont(new Font(" Regular script ",Font.PLAIN,20));
banjitext.setFont(new Font(" Regular script ",Font.PLAIN,20));
yuanxi.setFont(new Font(" Regular script ",Font.PLAIN,20));
yuanxitext.setFont(new Font(" Regular script ",Font.PLAIN,20));
chongzhi.setFont(new Font(" Regular script ",Font.PLAIN,20));
tijiao.setFont(new Font(" Regular script ",Font.PLAIN,20));
jieguo.setFont(new Font(" Regular script ",Font.PLAIN,20));
jieguo.setForeground(Color.RED);
studentidtext.setPreferredSize(new Dimension(120,25));
nametext.setPreferredSize(new Dimension(300,25));
sextext.setPreferredSize(new Dimension(50,25));
banjitext.setPreferredSize(new Dimension(300,25));
yuanxitext.setPreferredSize(new Dimension(300,25));
Connection conn = DBUtil.getConnectDb();
String sql="select name from department";
PreparedStatement stm = null;
ResultSet rs = null;
try {
stm = conn.prepareStatement(sql);
rs = stm.executeQuery();
while(rs.next()){
yuanxitext.addItem(rs.getString(1));
}
} catch (SQLException ex) {
ex.printStackTrace();
} finally {
DBUtil.CloseDB(rs, stm, conn);
}
Connection conn1 = DBUtil.getConnectDb();
String sql1="select name from class";
PreparedStatement stm1 = null;
ResultSet rs1 = null;
try {
stm1 = conn1.prepareStatement(sql1);
rs1 = stm1.executeQuery();
while(rs1.next()){
banjitext.addItem(rs1.getString(1));
}
} catch (SQLException ex1) {
ex1.printStackTrace();
} finally {
DBUtil.CloseDB(rs1, stm1, conn1);
}
sextext.addItem(" male ");
sextext.addItem(" Woman ");
sextext.setSelectedIndex(0);
banjitext.setSelectedIndex(0);
yuanxitext.setSelectedIndex(0);
springLayout.putConstraint(SpringLayout.NORTH,biaoti,20,SpringLayout.NORTH,container);
springLayout.putConstraint(SpringLayout.WEST,biaoti,250,SpringLayout.WEST,container);
springLayout.putConstraint(SpringLayout.NORTH,studentid,20,SpringLayout.SOUTH,biaoti);
springLayout.putConstraint(SpringLayout.WEST,studentid,100,SpringLayout.WEST,container);
springLayout.putConstraint(SpringLayout.NORTH,studentidtext,0,SpringLayout.NORTH,studentid);
springLayout.putConstraint(SpringLayout.WEST,studentidtext,20,SpringLayout.EAST,studentid);
springLayout.putConstraint(SpringLayout.NORTH,name,20,SpringLayout.SOUTH,studentid);
springLayout.putConstraint(SpringLayout.EAST,name,0,SpringLayout.EAST,studentid);
springLayout.putConstraint(SpringLayout.NORTH,nametext,0,SpringLayout.NORTH,name);
springLayout.putConstraint(SpringLayout.WEST,nametext,20,SpringLayout.EAST,name);
springLayout.putConstraint(SpringLayout.NORTH,sex,20,SpringLayout.SOUTH,name);
springLayout.putConstraint(SpringLayout.WEST,sex,0,SpringLayout.WEST,studentid);
springLayout.putConstraint(SpringLayout.NORTH,sextext,0,SpringLayout.NORTH,sex);
springLayout.putConstraint(SpringLayout.WEST,sextext,20,SpringLayout.EAST,sex);
springLayout.putConstraint(SpringLayout.NORTH,banji,20,SpringLayout.SOUTH,sex);
springLayout.putConstraint(SpringLayout.EAST,banji,0,SpringLayout.EAST,studentid);
springLayout.putConstraint(SpringLayout.NORTH,banjitext,0,SpringLayout.NORTH,banji);
springLayout.putConstraint(SpringLayout.WEST,banjitext,20,SpringLayout.EAST,banji);
springLayout.putConstraint(SpringLayout.NORTH,yuanxi,20,SpringLayout.SOUTH,banji);
springLayout.putConstraint(SpringLayout.EAST,yuanxi,0,SpringLayout.EAST,studentid);
springLayout.putConstraint(SpringLayout.NORTH,yuanxitext,0,SpringLayout.NORTH,yuanxi);
springLayout.putConstraint(SpringLayout.WEST,yuanxitext,20,SpringLayout.EAST,yuanxi);
springLayout.putConstraint(SpringLayout.NORTH,chongzhi,50,SpringLayout.NORTH,yuanxi);
springLayout.putConstraint(SpringLayout.WEST,chongzhi,150,SpringLayout.WEST,container);
springLayout.putConstraint(SpringLayout.NORTH,tijiao,0,SpringLayout.NORTH,chongzhi);
springLayout.putConstraint(SpringLayout.WEST,tijiao,100,SpringLayout.EAST,chongzhi);
springLayout.putConstraint(SpringLayout.NORTH,jieguo,50,SpringLayout.NORTH,chongzhi);
springLayout.putConstraint(SpringLayout.WEST,jieguo,0,SpringLayout.WEST,chongzhi);
chongzhi.addActionListener(new chongzhiListener());
tijiao.addActionListener(new tijiaoListener());
setSize(600,500);
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setResizable(false);
setVisible(true);
}
public class chongzhiListener implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
studentidtext.setText("");
nametext.setText("");
sextext.setSelectedIndex(0);
banjitext.setSelectedIndex(0);
yuanxitext.setSelectedIndex(0);
}
}
public class tijiaoListener implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
String studentidd=studentidtext.getText();
String namee=nametext.getText();
String sexx=sextext.getSelectedItem().toString().trim();
String banjiji=banjitext.getSelectedItem().toString().trim();
String yuanxixi=yuanxitext.getSelectedItem().toString().trim();
if("".equals(studentidd)){
jieguo.setText(" Student ID cannot be empty , Please fill in the student number ");
}else if("".equals(namee)){
jieguo.setText(" Name cannot be empty , Please fill in your name ");
}else{
Connection conn = DBUtil.getConnectDb();
String sql="select studentid from student";
PreparedStatement stm = null;
ResultSet rs = null;
int flag=0;
try {
stm = conn.prepareStatement(sql);
rs = stm.executeQuery();
while(rs.next()){
if(studentidd.equals(rs.getString(1))){
flag=1;
}
}
} catch (SQLException ex) {
ex.printStackTrace();
} finally {
DBUtil.CloseDB(rs, stm, conn);
}
if(flag==1){
jieguo.setText(" The student number has been occupied , Please fill in the student number again ");
studentidtext.setText("");
}else{
String banjijiji = null;
String yuanxixixix=null;
Connection conn2 = DBUtil.getConnectDb();
String sql2="select id from class where name='"+banjiji+"'";
PreparedStatement stm2 = null;
ResultSet rs2 = null;
try {
stm2 = conn2.prepareStatement(sql2);
rs2 = stm2.executeQuery();
while(rs2.next()){
banjijiji= rs2.getString(1);
}
} catch (SQLException ex2) {
ex2.printStackTrace();
} finally {
DBUtil.CloseDB(rs2, stm2, conn2);
}
Connection conn3 = DBUtil.getConnectDb();
String sql3="select id from department where name='"+yuanxixi+"'";
PreparedStatement stm3 = null;
ResultSet rs3 = null;
try {
stm3 = conn3.prepareStatement(sql3);
rs3 = stm3.executeQuery();
while(rs3.next()){
yuanxixixix= rs3.getString(1);
}
} catch (SQLException ex3) {
ex3.printStackTrace();
} finally {
DBUtil.CloseDB(rs3, stm3, conn3);
}
Connection conn1 = DBUtil.getConnectDb();
String sql1="insert into student values (?,?,?,?,?,?,?,?,?,?)";
PreparedStatement stm1 = null;
ResultSet rs1 = null;
try {
stm1 = conn1.prepareStatement(sql1);
stm1.setString(1,studentidd);
stm1.setString(2,namee);
stm1.setString(3,sexx);
stm1.setString(4,banjijiji);
stm1.setString(5,yuanxixixix);
stm1.setString(6,null);
stm1.setString(7,null);
stm1.setString(8,"123456");
stm1.setInt(9,0);
stm1.setString(10," Message board : Please remember to change your password for your security , Here you can write down what you want to do , Prevent forgetting .");
stm1.executeUpdate();
} catch (SQLException ex1) {
ex1.printStackTrace();
} finally {
DBUtil.CloseDB(rs1, stm1, conn1);
}
jieguo.setText(" Add student successfully !");
}
}
}
}
public static void main(String[] args) {
new tianjiaxuesheng();
}
}
Revise students :
package com.yu.web.admin.xueshengguanli;
import com.yu.util.DBUtil;
import javax.swing.;
import java.awt.;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class xiugaixuesheng extends JFrame{
JLabel biaoti=new JLabel(“ Modify student form ”);
JLabel studentid=new JLabel(“ Student number :”);
JTextField studentidtext=new JTextField();
JLabel name=new JLabel(“ full name :”);
JTextField nametext=new JTextField();
JLabel sex=new JLabel(“ Gender :”);
JComboBox sextext=new JComboBox<>();
JLabel banji=new JLabel(“ class :”);
JComboBox banjitext=new JComboBox<>();
JLabel yuanxi=new JLabel(“ departments :”);
JComboBox yuanxitext=new JComboBox<>();
JLabel birthday=new JLabel(“ Date of birth :”);
JTextField birthdaytext=new JTextField();
JLabel native_place=new JLabel(“ The household registration :”);
JTextField native_placetext=new JTextField();
JLabel password=new JLabel(“ password :”);
JTextField passwordtext=new JTextField();
JLabel stste=new JLabel(“ identity :”);
JComboBox statetext=new JComboBox<>();
JButton chongzhi=new JButton(“ Reset ”);
JButton tijiao=new JButton(“ Submit ”);
JLabel jie1=new JLabel(“”);
JLabel jie2=new JLabel(“”);
JLabel jie3=new JLabel(“”);
JLabel jie4=new JLabel(“”);
JLabel jie5=new JLabel(“”);
JLabel jie6=new JLabel(“”);
JLabel jie7=new JLabel(“”);
JLabel jie8=new JLabel(“”);
JLabel jie9=new JLabel(“”);
JLabel jieguo=new JLabel(“”);
JLabel jie10=new JLabel(“”);
public xiugaixuesheng(String id,String na,String se,String cl,String de,String br,String nat,String pa,int st,String liu){
super(“ Revise students ”);
Container container=getContentPane();
SpringLayout springLayout=new SpringLayout();
container.setLayout(springLayout);
container.add(banji);
container.add(sex);
container.add(biaoti);
container.add(studentid);
container.add(studentidtext);
container.add(name);
container.add(nametext);
container.add(sextext);
container.add(banjitext);
container.add(yuanxi);
container.add(yuanxitext);
container.add(chongzhi);
container.add(tijiao);
container.add(jieguo);
container.add(birthdaytext);
container.add(birthday);
container.add(native_place);
container.add(native_placetext);
container.add(password);
container.add(passwordtext);
container.add(stste);
container.add(statetext);
biaoti.setFont(new Font(“ Regular script ”,Font.PLAIN,25));
banji.setFont(new Font(“ Regular script ”,Font.PLAIN,20));
sex.setFont(new Font(“ Regular script ”,Font.PLAIN,20));
studentid.setFont(new Font(“ Regular script ”,Font.PLAIN,20));
studentidtext.setFont(new Font(“ Regular script ”,Font.PLAIN,20));
name.setFont(new Font(“ Regular script ”,Font.PLAIN,20));
nametext.setFont(new Font(“ Regular script ”,Font.PLAIN,20));
sextext.setFont(new Font(“ Regular script ”,Font.PLAIN,20));
banjitext.setFont(new Font(“ Regular script ”,Font.PLAIN,20));
yuanxi.setFont(new Font(“ Regular script ”,Font.PLAIN,20));
yuanxitext.setFont(new Font(“ Regular script ”,Font.PLAIN,20));
chongzhi.setFont(new Font(“ Regular script ”,Font.PLAIN,20));
tijiao.setFont(new Font(“ Regular script ”,Font.PLAIN,20));
jieguo.setFont(new Font(“ Regular script ”,Font.PLAIN,20));
birthday.setFont(new Font(“ Regular script ”,Font.PLAIN,20));
birthdaytext.setFont(new Font(“ Regular script ”,Font.PLAIN,20));
native_place.setFont(new Font(“ Regular script ”,Font.PLAIN,20));
native_placetext.setFont(new Font(“ Regular script ”,Font.PLAIN,20));
password.setFont(new Font(“ Regular script ”,Font.PLAIN,20));
passwordtext.setFont(new Font(“ Regular script ”,Font.PLAIN,20));
stste.setFont(new Font(“ Regular script ”,Font.PLAIN,20));
statetext.setFont(new Font(“ Regular script ”,Font.PLAIN,20));
jieguo.setForeground(Color.RED);
studentidtext.setPreferredSize(new Dimension(120,25));
nametext.setPreferredSize(new Dimension(300,25));
sextext.setPreferredSize(new Dimension(50,25));
banjitext.setPreferredSize(new Dimension(300,25));
yuanxitext.setPreferredSize(new Dimension(300,25));
birthdaytext.setPreferredSize(new Dimension(120,25));
native_placetext.setPreferredSize(new Dimension(300,25));
passwordtext.setPreferredSize(new Dimension(80,25));
statetext.setPreferredSize(new Dimension(100,25));
Connection conn = DBUtil.getConnectDb();
int i1=0;
String sql=“select name,id from department”;
PreparedStatement stm = null;
ResultSet rs = null;
try {
int number=0;
stm = conn.prepareStatement(sql);
rs = stm.executeQuery();
while(rs.next()){
if(de.equals(rs.getString(2))){
i1=number;
}
yuanxitext.addItem(rs.getString(1));
number++;
}
} catch (SQLException ex) {
ex.printStackTrace();
} finally {
DBUtil.CloseDB(rs, stm, conn);
}
Connection conn1 = DBUtil.getConnectDb();
String sql1=“select name,id from class”;
PreparedStatement stm1 = null;
ResultSet rs1 = null;
int i2=0;
try {
int number=0;
stm1 = conn1.prepareStatement(sql1);
rs1 = stm1.executeQuery();
while(rs1.next()){
if(cl.equals(rs1.getString(2))){
i2=number;
}
banjitext.addItem(rs1.getString(1));
number++;
}
} catch (SQLException ex1) {
ex1.printStackTrace();
} finally {
DBUtil.CloseDB(rs1, stm1, conn1);
}
sextext.addItem(“ male ”);
sextext.addItem(“ Woman ”);
if(se.equals(“ Woman ”)){
sextext.setSelectedIndex(1);
jie3.setText(“1”);
}else{
sextext.setSelectedIndex(0);
jie3.setText(“0”);
}
statetext.addItem(“ Student ”);
statetext.addItem(“ Administrators ”);
if(st0){
statetext.setSelectedIndex(0);
jie9.setText(“0”);
}else {
statetext.setSelectedIndex(1);
jie9.setText(“1”);
}
banjitext.setSelectedIndex(i2);
yuanxitext.setSelectedIndex(i1);
jie1.setText(id);
jie2.setText(na);
jie4.setText(String.valueOf(i2));
jie5.setText(String.valueOf(i1));
jie6.setText(br);
jie7.setText(nat);
jie8.setText(pa);
studentidtext.setText(id);
nametext.setText(na);
birthdaytext.setText(br);
native_placetext.setText(nat);
passwordtext.setText(pa);
jie10.setText(liu);
springLayout.putConstraint(SpringLayout.NORTH,biaoti,20,SpringLayout.NORTH,container);
springLayout.putConstraint(SpringLayout.WEST,biaoti,250,SpringLayout.WEST,container);
springLayout.putConstraint(SpringLayout.NORTH,studentid,20,SpringLayout.SOUTH,biaoti);
springLayout.putConstraint(SpringLayout.WEST,studentid,100,SpringLayout.WEST,container);
springLayout.putConstraint(SpringLayout.NORTH,studentidtext,0,SpringLayout.NORTH,studentid);
springLayout.putConstraint(SpringLayout.WEST,studentidtext,20,SpringLayout.EAST,studentid);
springLayout.putConstraint(SpringLayout.NORTH,name,20,SpringLayout.SOUTH,studentid);
springLayout.putConstraint(SpringLayout.EAST,name,0,SpringLayout.EAST,studentid);
springLayout.putConstraint(SpringLayout.NORTH,nametext,0,SpringLayout.NORTH,name);
springLayout.putConstraint(SpringLayout.WEST,nametext,20,SpringLayout.EAST,name);
springLayout.putConstraint(SpringLayout.NORTH,sex,20,SpringLayout.SOUTH,name);
springLayout.putConstraint(SpringLayout.WEST,sex,0,SpringLayout.WEST,studentid);
springLayout.putConstraint(SpringLayout.NORTH,sextext,0,SpringLayout.NORTH,sex);
springLayout.putConstraint(SpringLayout.WEST,sextext,20,SpringLayout.EAST,sex);
springLayout.putConstraint(SpringLayout.NORTH,banji,20,SpringLayout.SOUTH,sex);
springLayout.putConstraint(SpringLayout.EAST,banji,0,SpringLayout.EAST,studentid);
springLayout.putConstraint(SpringLayout.NORTH,banjitext,0,SpringLayout.NORTH,banji);
springLayout.putConstraint(SpringLayout.WEST,banjitext,20,SpringLayout.EAST,banji);
springLayout.putConstraint(SpringLayout.NORTH,yuanxi,20,SpringLayout.SOUTH,banji);
springLayout.putConstraint(SpringLayout.EAST,yuanxi,0,SpringLayout.EAST,studentid);
springLayout.putConstraint(SpringLayout.NORTH,yuanxitext,0,SpringLayout.NORTH,yuanxi);
springLayout.putConstraint(SpringLayout.WEST,yuanxitext,20,SpringLayout.EAST,yuanxi);
springLayout.putConstraint(SpringLayout.NORTH,birthday,20,SpringLayout.SOUTH,yuanxi);
springLayout.putConstraint(SpringLayout.EAST,birthday,0,SpringLayout.EAST,studentid);
springLayout.putConstraint(SpringLayout.NORTH,birthdaytext,0,SpringLayout.NORTH,birthday);
springLayout.putConstraint(SpringLayout.WEST,birthdaytext,20,SpringLayout.EAST,birthday);
springLayout.putConstraint(SpringLayout.NORTH,native_place,20,SpringLayout.SOUTH,birthday);
springLayout.putConstraint(SpringLayout.EAST,native_place,0,SpringLayout.EAST,studentid);
springLayout.putConstraint(SpringLayout.NORTH,native_placetext,0,SpringLayout.NORTH,native_place);
springLayout.putConstraint(SpringLayout.WEST,native_placetext,20,SpringLayout.EAST,native_place);
springLayout.putConstraint(SpringLayout.NORTH,password,20,SpringLayout.SOUTH,native_place);
springLayout.putConstraint(SpringLayout.EAST,password,0,SpringLayout.EAST,studentid);
springLayout.putConstraint(SpringLayout.NORTH,passwordtext,0,SpringLayout.NORTH,password);
springLayout.putConstraint(SpringLayout.WEST,passwordtext,20,SpringLayout.EAST,password);
springLayout.putConstraint(SpringLayout.NORTH,stste,20,SpringLayout.SOUTH,password);
springLayout.putConstraint(SpringLayout.EAST,stste,0,SpringLayout.EAST,studentid);
springLayout.putConstraint(SpringLayout.NORTH,statetext,0,SpringLayout.NORTH,stste);
springLayout.putConstraint(SpringLayout.WEST,statetext,20,SpringLayout.EAST,stste);
springLayout.putConstraint(SpringLayout.NORTH,chongzhi,50,SpringLayout.NORTH,stste);
springLayout.putConstraint(SpringLayout.WEST,chongzhi,150,SpringLayout.WEST,container);
springLayout.putConstraint(SpringLayout.NORTH,tijiao,0,SpringLayout.NORTH,chongzhi);
springLayout.putConstraint(SpringLayout.WEST,tijiao,100,SpringLayout.EAST,chongzhi);
springLayout.putConstraint(SpringLayout.NORTH,jieguo,50,SpringLayout.NORTH,chongzhi);
springLayout.putConstraint(SpringLayout.WEST,jieguo,0,SpringLayout.WEST,chongzhi);
chongzhi.addActionListener(new chongzhiListener());
tijiao.addActionListener(new tijiaoListener());
setSize(600,700);
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setResizable(false);
setVisible(true);
}
public class chongzhiListener implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
studentidtext.setText(jie1.getText());
nametext.setText(jie2.getText());
sextext.setSelectedIndex(Integer.parseInt(jie3.getText()));
banjitext.setSelectedIndex(Integer.parseInt(jie4.getText()));
yuanxitext.setSelectedIndex(Integer.parseInt(jie5.getText()));
birthdaytext.setText(jie6.getText());
native_placetext.setText(jie7.getText());
passwordtext.setText(jie8.getText());
statetext.setSelectedIndex(Integer.parseInt(jie9.getText()));
}
}
public class tijiaoListener implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
String studentidd=studentidtext.getText();
String namee=nametext.getText();
String sexx=sextext.getSelectedItem().toString().trim();
String banjiji=banjitext.getSelectedItem().toString().trim();
String yuanxixi=yuanxitext.getSelectedItem().toString().trim();
String birthdayy=birthdaytext.getText();
String native_placee=native_placetext.getText();
String passwordd=passwordtext.getText();
String statee=statetext.getSelectedItem().toString().trim();
if(“”.equals(studentidd)){
jieguo.setText(“ Student ID cannot be empty , Please fill in the student number ”);
}else if(“”.equals(namee)){
jieguo.setText(“ Name cannot be empty , Please fill in your name ”);
}else if(“”.equals(passwordd)){
jieguo.setText(“ The password cannot be empty , Please fill in your name ”);
}else {
Connection conn = DBUtil.getConnectDb();
String sql=“select studentid from student”;
PreparedStatement stm = null;
ResultSet rs = null;
int flag=0;
try {
stm = conn.prepareStatement(sql);
rs = stm.executeQuery();
while(rs.next()){
if(studentidd.equals(rs.getString(1))&&!jie1.getText().equals(rs.getString(1))){
flag=1;
}
}
} catch (SQLException ex) {
ex.printStackTrace();
} finally {
DBUtil.CloseDB(rs, stm, conn);
}
if(flag1){
jieguo.setText(“ The student number has been occupied , Please fill in the student number again ”);
studentidtext.setText(“”);
}else{
String banjijiji = null;
String yuanxixixix=null;
Connection conn2 = DBUtil.getConnectDb();
String sql2=“select id from class where name='”+banjiji+“'”;
PreparedStatement stm2 = null;
ResultSet rs2 = null;
try {
stm2 = conn2.prepareStatement(sql2);
rs2 = stm2.executeQuery();
while(rs2.next()){
banjijiji= rs2.getString(1);
}
} catch (SQLException ex2) {
ex2.printStackTrace();
} finally {
DBUtil.CloseDB(rs2, stm2, conn2);
}
Connection conn3 = DBUtil.getConnectDb();
String sql3=“select id from department where name='”+yuanxixi+“'”;
PreparedStatement stm3 = null;
ResultSet rs3 = null;
try {
stm3 = conn3.prepareStatement(sql3);
rs3 = stm3.executeQuery();
while(rs3.next()){
yuanxixixix= rs3.getString(1);
}
} catch (SQLException ex3) {
ex3.printStackTrace();
} finally {
DBUtil.CloseDB(rs3, stm3, conn3);
}
int s=0;
if(“ Administrators ”.equals(statee)){
s=1;
}
Connection conn1 = DBUtil.getConnectDb();
String sql1=“update student set studentid='”+studentidd+“‘,name=’”+namee+“‘,sex=’”+sexx+“‘,class=’”+banjijiji+“‘,department=’”+yuanxixixix+“‘,birthday=’”+birthdayy+“‘,native_place=’”+native_placee+“‘,password=’”+passwordd+“‘,state=’”+s+“‘,liuyan=’”+jie10.getText()+“‘where studentid=’”+jie1.getText()+“'”;
PreparedStatement stm1 = null;
ResultSet rs1 = null;
try {
stm1 = conn1.prepareStatement(sql1);
System.out.println(stm1);
stm1.executeUpdate();
} catch (SQLException ex1) {
ex1.printStackTrace();
} finally {
DBUtil.CloseDB(rs1, stm1, conn1);
}
jieguo.setText(“ Modify student success !”);
}
}
}
}
public static void main(String[] args) {
new xiugaixuesheng(“”,“,”,“”,“”,“”,“”,“”,“”,1,“”);
}
}
边栏推荐
- To achieve good software testing results, it is a prerequisite to build a good testing environment
- C#启动程序传递参数丢失双引号,如何解决?
- What is the role of software validation testing? What is the price of the confirmation test report?
- RTOS 多线程下hardfault问题总结
- Iframe is simple to use, iframe is obtained, iframe element value is obtained, and iframe information of parent page is obtained
- 106. 简易聊天室9:使用 Socket 传递音频
- 第十五周作业
- WebGL发布之后不可以输入中文解决方案
- 紧急行政中止令下达 Juul暂时可以继续在美国销售电子烟产品
- Advanced technology Er, meet internship position information
猜你喜欢
Jmeter中的断言使用讲解
[operation tutorial] how does the tsingsee Qingxi video platform import the old database into the new database?
How to design test cases
UEFI: repair efi/gpt bootloader
【OpenCV】—输入输出XML和YAML文件
WebGL谷歌提示内存不够(RuntimeError:memory access out of bounds,火狐提示索引超出界限(RuntimeError:index out of bounds)
Fault: 0x800ccc1a error when outlook sends and receives mail
C language: count the number of characters, numbers and spaces
Easyplayer streaming media player plays HLS video. Technical optimization of slow starting speed
C#程序终止问题CLR20R3解决方法
随机推荐
Unity--configurable joint -- a simple tutorial to get you started with configurable joints
声纹技术(一):声纹技术的前世今生
What is the difference between TP5 and tp6?
Summary of NLP data enhancement methods
Le labyrinthe des huit diagrammes de la bataille de cazy Chang'an
Trendmicro:apex one server tools folder
flutter 获取顶部状态栏的高度
Notes on key vocabulary of the original English work biography of jobs (I) [introduction]
How to solve the 10061 error of MySQL in Linux
flutter 多语言的intl: ^0.17.0导不进去
annotation lib 和 processor lib如何引用
检测点是否在多边形内
Object. Can defineproperty also listen for array changes?
《乔布斯传》英文原著重点词汇笔记(一)【 Introduction 】
Notes on key words in the original English work biography of jobs (VI) [chapter three]
六级易混词整理
Jmeter中的断言使用讲解
在哪个平台买股票开户安全?求分享
[MySQL] understanding and use of indexes
Getting to know the generation confrontation network (12) -- using pytoch to build wgan-gp to generate handwritten digits