《java高级开发》课程设计
JPanel jp = new JPanel(); //创建个JPanel jp.setOpaque(false); //把JPanel设置为透明 这样就不会遮住后面的背景 这样你就能在JPanel随意加组件了 c.add(jp); setSize(540, 450); setVisible(true);*/ /*JLabel p=new JLabel(); p.setOpaque(true); p.setBackground(Color.red);*/ /*JLabel p=new JLabel(); JLabel l=new JLabel(); Icon icon=new ImageIcon(\ //在此直接创建对象 l.setIcon(icon); l.setBounds(0, 0, icon.getIconWidth(),icon.getIconHeight()); p.add(l,new Integer(Integer.MIN_VALUE)); getContentPane().add(p); pack(); //窗口适应组件大小 setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //用来关闭窗口的*/ setVisible(true); setTitle(\学生成绩管理系统\ getContentPane().setLayout(new GridLayout(3,1)); getContentPane().add(p1); getContentPane().add(p2); getContentPane().add(p3); p1.add(la1); p1.add(name); p2.add(la2); p2.add(pw); p3.add(b1); p3.add(b2); setBounds(500, 250, 100, 100); pack(); setVisible(true); pw.setEchoChar('*'); b1.addActionListener(this); b2.addActionListener(this); } /* public void setBak(){ ((JPanel)this.getContentPane()).setOpaque(false); ImageIcon img = new ImageIcon(\添加图片 JLabel background = new JLabel(img);this.getLayeredPane().add(background, new Integer(Integer.MIN_VALUE)); background.setBounds(0, 0, img.getIconWidth(), img.getIconHeight()); }*/
11
《java高级开发》课程设计
public void actionPerformed(ActionEvent e) { if(e.getActionCommand()==\登录\ String password=pw.getText(); String user=name.getText(); if(user.equals(\ Function function=new Function(); function.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(false); } else{ JOptionPane.showMessageDialog(null, \用户名或密码错误\\JOptionPane.INFORMATION_MESSAGE); } } else if(e.getActionCommand()==\退出\ System.exit(0); } } }
DateBaseCreate.java
package scoreManagement; import java.awt.*; import java.awt.event.*; import javax.swing.*; //登录界面 public class Login extends JFrame implements ActionListener{ JButton b1=new JButton(\登录\ JButton b2=new JButton(\退出\ JLabel la1=new JLabel(\用户名\ JLabel la2=new JLabel(\密 码\ JPanel p1=new JPanel(); JPanel p2=new JPanel(); JPanel p3=new JPanel(); JTextField name=new JTextField(15); JPasswordField pw=new JPasswordField(15); public Login(){ /*setBak(); //调用背景方法 Container c = getContentPane(); //获取JFrame面板
12
《java高级开发》课程设计
JPanel jp = new JPanel(); //创建个JPanel jp.setOpaque(false); //把JPanel设置为透明 这样就不会遮住后面的背景 这样你就能在JPanel随意加组件了 c.add(jp); setSize(540, 450); setVisible(true);*/ /*JLabel p=new JLabel(); p.setOpaque(true); p.setBackground(Color.red);*/ /*JLabel p=new JLabel(); JLabel l=new JLabel(); Icon icon=new ImageIcon(\ //在此直接创建对象 l.setIcon(icon); l.setBounds(0, 0, icon.getIconWidth(),icon.getIconHeight()); p.add(l,new Integer(Integer.MIN_VALUE)); getContentPane().add(p); pack(); //窗口适应组件大小 setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //用来关闭窗口的*/ setVisible(true); setTitle(\学生成绩管理系统\ getContentPane().setLayout(new GridLayout(3,1)); getContentPane().add(p1); getContentPane().add(p2); getContentPane().add(p3); p1.add(la1); p1.add(name); p2.add(la2); p2.add(pw); p3.add(b1); p3.add(b2); setBounds(500, 250, 100, 100); pack(); setVisible(true); pw.setEchoChar('*'); b1.addActionListener(this); b2.addActionListener(this); } /* public void setBak(){ ((JPanel)this.getContentPane()).setOpaque(false); ImageIcon img = new ImageIcon(\添加图片 JLabel background = new JLabel(img);this.getLayeredPane().add(background, new Integer(Integer.MIN_VALUE)); background.setBounds(0, 0, img.getIconWidth(), img.getIconHeight()); }*/
13
《java高级开发》课程设计
public void actionPerformed(ActionEvent e) { if(e.getActionCommand()==\登录\ String password=pw.getText(); String user=name.getText(); if(user.equals(\ Function function=new Function(); function.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(false); } else{ JOptionPane.showMessageDialog(null, \用户名或密码错误\\JOptionPane.INFORMATION_MESSAGE); } } else if(e.getActionCommand()==\退出\ System.exit(0); } } } 4.系统实现与测试
4.1 功能模块测试
由于时间和自身能力所限,我们只进行了功能测试(黑盒测试)。 1) 登陆界面测试
2) 学生信息查询,删除,修改,添加及导入导出功能的测试 3) 课程信息查询,删除,修改,添加及导入导出功能的测试 4) 成绩信息查询,删除,修改,添加及导入导出功能的测试 经过测试本系统基本实现了所要求的功能,能够比较方便的,快捷的完成所执行操作。
14
《java高级开发》课程设计
4.2 系统测试截图
部分截图如下:
图4.1-1 登录页面
图4.1-2 主界面
15
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库基于SWING和MyBatis的学生成绩管理系统设计与实现(3)在线全文阅读。
相关推荐: