團隊的做業:學生信息管理系統java
周菲(隊長) 201810812007windows
孔繁燕 201810812001ide
Alpha敏捷衝刺:測試
1、 站立式會議照片:ui
2、每一個人的工做:this
周菲:設計
今天已完成:一、完成登錄界面響應窗體,登錄成功即出現主窗體,登錄失敗消息窗體提示;二、完成主界面的設計;3d
遇到的問題:窗體點擊響應失敗;orm
明天計劃完成:學生信息管理窗體實現添加學生信息功能;blog
孔繁燕:
今天已完成:完成主界面的設計。
遇到的問題;窗體點擊響應失敗;
明天計劃完成:學生信息管理窗體實現添加學生信息功能測試;
3、項目燃盡圖
四、功能截圖及代碼:
登錄系統失敗消息提示:
登錄系統成功則顯示主窗體:
部分代碼以下:
package ui; import java.awt.BorderLayout; import java.awt.EventQueue; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Properties; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; import model.LoginMessage; import service.UserService; import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.JButton; import java.awt.Font; import java.awt.Color; import java.awt.SystemColor; import java.awt.Window.Type; import java.awt.Toolkit; public class LoginFrame extends JFrame { private JPanel contentPane; private JTextField txtUsername; private JTextField txtPassword; public LoginFrame() { setIconImage(Toolkit.getDefaultToolkit().getImage(LoginFrame.class.getResource("/com/sun/java/swing/plaf/windows/icons/Computer.gif"))); setForeground(new Color(70, 130, 180)); setBackground(new Color(70, 130, 180)); setTitle("教務登錄系統v2.0"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 450, 300); contentPane = new JPanel(); contentPane.setBackground(new Color(173, 216, 230)); contentPane.setBorder(new EmptyBorder(0, 0, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); JLabel lblUsername = new JLabel("用戶名:"); lblUsername.setForeground(new Color(25, 25, 112)); lblUsername.setFont(new Font("微軟雅黑", Font.ITALIC, 16)); lblUsername.setBounds(10, 54, 93, 30); contentPane.add(lblUsername); JLabel lblPassword = new JLabel("密碼:"); lblPassword.setForeground(new Color(25, 25, 112)); lblPassword.setFont(new Font("微軟雅黑", Font.ITALIC, 16)); lblPassword.setBounds(10, 109, 93, 30); contentPane.add(lblPassword); txtUsername = new JTextField(); txtUsername.setBounds(102, 60, 246, 21); contentPane.add(txtUsername); txtUsername.setColumns(10); txtPassword = new JTextField(); txtPassword.setColumns(10); txtPassword.setBounds(102, 115, 246, 21); contentPane.add(txtPassword); JButton btnLogin = new JButton("登錄"); btnLogin.setFont(new Font("微軟雅黑", Font.PLAIN, 12)); btnLogin.setForeground(new Color(25, 25, 112)); btnLogin.setBackground(new Color(25, 25, 112)); btnLogin.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { //得到用戶名 String username=txtUsername.getText(); String password=txtPassword.getText(); UserService userService=new UserService(); LoginMessage loginMessage=userService.login(username, password); //顯示登錄信息 if(loginMessage.isLogin())//登錄成功則顯示主窗體 { //主窗體設計 MainFrame mainFrame=new MainFrame(); mainFrame.setVisible(true); LoginFrame.this.setVisible(false); } else//未登錄成功彈窗顯示 { LoginMessageDialog loginDialog=new LoginMessageDialog(loginMessage.getMessage()); loginDialog.setVisible(true); } } }); btnLogin.setBounds(102, 203, 93, 23); contentPane.add(btnLogin); JButton btnCancel = new JButton("退出"); btnCancel.setFont(new Font("微軟雅黑", Font.PLAIN, 12)); btnCancel.setForeground(new Color(25, 25, 112)); btnCancel.setBackground(new Color(25, 25, 112)); btnCancel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { //取消登錄 System.exit(0); } }); btnCancel.setBounds(255, 203, 93, 23); contentPane.add(btnCancel); } }