Skip to content

Commit

Permalink
Finished basic modules
Browse files Browse the repository at this point in the history
Basic modules finished, some small bugs to fix.
  • Loading branch information
ZHRMoe committed Apr 15, 2015
1 parent 443c6de commit 0c7d0be
Show file tree
Hide file tree
Showing 12 changed files with 133 additions and 70 deletions.
182 changes: 118 additions & 64 deletions .idea/workspace.xml

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 3 additions & 1 deletion src/com/bistuSMS/SMSAddStudent.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
15 changes: 11 additions & 4 deletions src/com/bistuSMS/SMSMainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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) {
Expand All @@ -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;
}
}
2 changes: 1 addition & 1 deletion src/com/bistuSMS/SMSWelcomeWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 0c7d0be

Please sign in to comment.