diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 968dfb0..0bae708 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -27,19 +27,40 @@ - + - - + + - - + + + + + + + + + + + + + + + + + + + + + + - + + @@ -64,14 +85,14 @@ @@ -109,6 +130,7 @@ + @@ -147,9 +169,8 @@ - - + @@ -448,41 +469,43 @@ - + + + - - + + + - + + - - - @@ -508,21 +531,68 @@ - + - + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -543,7 +613,6 @@ - @@ -551,7 +620,6 @@ - @@ -567,7 +635,6 @@ - @@ -602,7 +669,6 @@ - @@ -610,7 +676,6 @@ - @@ -626,7 +691,6 @@ - @@ -661,7 +725,6 @@ - @@ -677,7 +740,6 @@ - @@ -699,53 +761,38 @@ - - - - - - - - - - - - - + - - + - + - - + - + - - + - + @@ -753,34 +800,41 @@ - - + - + + + + + + + + - - + + + + + - + - + - + - - - - - + + + diff --git a/out/production/Student-Management-System/com/bistuSMS/SMSAddStudent$1.class b/out/production/Student-Management-System/com/bistuSMS/SMSAddStudent$1.class index 62ef690..ee7f7af 100644 Binary files a/out/production/Student-Management-System/com/bistuSMS/SMSAddStudent$1.class and b/out/production/Student-Management-System/com/bistuSMS/SMSAddStudent$1.class differ diff --git a/out/production/Student-Management-System/com/bistuSMS/SMSAddStudent.class b/out/production/Student-Management-System/com/bistuSMS/SMSAddStudent.class index 6e99abc..85629e5 100644 Binary files a/out/production/Student-Management-System/com/bistuSMS/SMSAddStudent.class and b/out/production/Student-Management-System/com/bistuSMS/SMSAddStudent.class differ diff --git a/out/production/Student-Management-System/com/bistuSMS/SMSMainWindow$1.class b/out/production/Student-Management-System/com/bistuSMS/SMSMainWindow$1.class index 61d6258..d65775c 100644 Binary files a/out/production/Student-Management-System/com/bistuSMS/SMSMainWindow$1.class and b/out/production/Student-Management-System/com/bistuSMS/SMSMainWindow$1.class differ diff --git a/out/production/Student-Management-System/com/bistuSMS/SMSMainWindow$2.class b/out/production/Student-Management-System/com/bistuSMS/SMSMainWindow$2.class index 9d737e6..a0b0cfb 100644 Binary files a/out/production/Student-Management-System/com/bistuSMS/SMSMainWindow$2.class and b/out/production/Student-Management-System/com/bistuSMS/SMSMainWindow$2.class differ diff --git a/out/production/Student-Management-System/com/bistuSMS/SMSMainWindow$3.class b/out/production/Student-Management-System/com/bistuSMS/SMSMainWindow$3.class index 8abbc13..400b2d0 100644 Binary files a/out/production/Student-Management-System/com/bistuSMS/SMSMainWindow$3.class and b/out/production/Student-Management-System/com/bistuSMS/SMSMainWindow$3.class differ diff --git a/out/production/Student-Management-System/com/bistuSMS/SMSMainWindow$4.class b/out/production/Student-Management-System/com/bistuSMS/SMSMainWindow$4.class index cc00343..937fe16 100644 Binary files a/out/production/Student-Management-System/com/bistuSMS/SMSMainWindow$4.class and b/out/production/Student-Management-System/com/bistuSMS/SMSMainWindow$4.class differ diff --git a/out/production/Student-Management-System/com/bistuSMS/SMSMainWindow.class b/out/production/Student-Management-System/com/bistuSMS/SMSMainWindow.class index bcf1fc6..e8e9f82 100644 Binary files a/out/production/Student-Management-System/com/bistuSMS/SMSMainWindow.class and b/out/production/Student-Management-System/com/bistuSMS/SMSMainWindow.class differ diff --git a/out/production/Student-Management-System/com/bistuSMS/SMSWelcomeWindow.class b/out/production/Student-Management-System/com/bistuSMS/SMSWelcomeWindow.class index 633435d..4df7c43 100644 Binary files a/out/production/Student-Management-System/com/bistuSMS/SMSWelcomeWindow.class and b/out/production/Student-Management-System/com/bistuSMS/SMSWelcomeWindow.class differ diff --git a/src/com/bistuSMS/SMSAddStudent.java b/src/com/bistuSMS/SMSAddStudent.java index c6f111e..51060f6 100644 --- a/src/com/bistuSMS/SMSAddStudent.java +++ b/src/com/bistuSMS/SMSAddStudent.java @@ -30,10 +30,11 @@ public class SMSAddStudent extends JFrame implements ActionListener { public JPanel panel5 = new JPanel(); public JPanel panel6 = new JPanel(); public SMSStudent addStudent; + public SMSStudentArray stuArray = SMSMainWindow.getStuArray(); public boolean addSucceed = false; public boolean windowClosed = false; - public SMSAddStudent() { + public SMSAddStudent(SMSStudentArray stuArray) { this.setLayout(new GridLayout(6, 1)); panel1.add(titleLabel); @@ -80,6 +81,7 @@ public void windowClosing(WindowEvent e) { public void actionPerformed(ActionEvent a) { if (a.getSource() == addBtn) { addStudent = new SMSStudent(stuNameTextField.getText(), stuSexTextField.getText(), stuClassTextField.getText(), stuNumberTextField.getText()); + stuArray.addStudent(addStudent); addSucceed = true; windowClosed = true; this.setVisible(false); diff --git a/src/com/bistuSMS/SMSMainWindow.java b/src/com/bistuSMS/SMSMainWindow.java index 8152eeb..300017d 100644 --- a/src/com/bistuSMS/SMSMainWindow.java +++ b/src/com/bistuSMS/SMSMainWindow.java @@ -19,7 +19,7 @@ public class SMSMainWindow extends JFrame{ JButton returnButton = new JButton("注销"); JButton removeButton = new JButton("删除"); - JButton addbutton = new JButton("add"); + JButton addButton = new JButton("添加"); Font font = new Font("Default",Font.PLAIN,20); Font titleFont = new Font("Default",Font.PLAIN,25); @@ -32,9 +32,10 @@ public class SMSMainWindow extends JFrame{ JScrollPane panel2 = new JScrollPane(); JPanel panel3 = new JPanel(); + public static SMSStudentArray studentArray = new SMSStudentArray(); + public SMSMainWindow (String user){ this.setTitle("学生管理系统"); - SMSStudentArray studentArray = new SMSStudentArray(); setLayout(null); this.setSize(800, 600); this.setLocationRelativeTo(null); @@ -117,6 +118,7 @@ public void removeTableModelListener(TableModelListener l) { panel3.setBounds(10, 500, 760, 100); panel3.add(returnButton); panel3.add(removeButton); + panel3.add(addButton); removeButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -135,14 +137,19 @@ public void actionPerformed(ActionEvent e) { setVisible(false); } }); - addbutton.addActionListener(new ActionListener() { + addButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { -// new SMSAddStudent(); + new SMSAddStudent(studentArray); + studentListTable.revalidate(); } }); add(panel3); this.setVisible(true); } + + public static SMSStudentArray getStuArray() { + return studentArray; + } } diff --git a/src/com/bistuSMS/SMSWelcomeWindow.java b/src/com/bistuSMS/SMSWelcomeWindow.java index b0027a9..fed47df 100644 --- a/src/com/bistuSMS/SMSWelcomeWindow.java +++ b/src/com/bistuSMS/SMSWelcomeWindow.java @@ -30,7 +30,7 @@ public SMSWelcomeWindow() { SMSSMSLabel.setFont(SMSFontMonaco); SMSWelcomeLogin = new JButton("进入系统"); SMSWelcomeQuit = new JButton("退出系统"); - SMSWelcomeMembers = new JLabel("Powered by Hu Bo, Xu Bo and Zhang Haoran"); + SMSWelcomeMembers = new JLabel("Powered by Xu Bo, Zhang Haoran, Zhang Zhu"); SMSWelcomeMembers.setFont(new Font("Default",Font.PLAIN,13)); SMSWelcomePanel = new JPanel[4];