好文档 - 专业文书写作范文服务资料分享网站

青岛理工JAVA实验5资料讲解

天下 分享 时间: 加入收藏 我要投稿 点赞

精品文档

import javax.swing.JButton; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JLabel; import javax.swing.JPasswordField; import javax.swing.JOptionPane; import javax.swing.JTextField; public class z extends JFrame{ public String JDriver =\r.jdbc.SQLServerDriver\ public String conURL =\host:1433;databaseName=test;user=sa;password=123\ class Display extends JFrame //菜单界面 { JButton b1=new JButton(\输入信息\ JButton b2=new JButton(\修改信息\ JButton b3=new JButton(\删除信息\ JButton b4=new JButton(\按照性别查找学生信息\ JButton b5=new JButton(\按照年龄查找学生信息\ JLabel a=new JLabel(\请选择想要进行的操作 \ Display() { super(\学生信息管理系统\ 0); setLocation(400,10setSize(500,400); 收集于网络,如有侵权请联系管理员删除

精品文档

; ; b3.setSize(100,50)setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 150); b2.setLocation(200b1.setLocation(50, setLayout(null); b4.setSize(200,50) ; b5.setSize(200,50),150); b3.setLocation(350a.setSize(500,50); add(b1);add(b2); ,150); 250); b5.setLocation(250b4.setLocation(25,add(b3);add(b4); add(b5);add(a); listen1(); } ,250); 50); ; ; b2.setSize(100,50)b1.setSize(100,50)a.setLocation(150, void listen1() //监听 { b1.addActionListener(new ActionListener()//输入信息 { public void actionPerformed(ActionEvent e ){ Create 收集于网络,如有侵权请联系管理员删除

精品文档

a=new Create(); ; }); b2.addActionListen a.setVisible(true)} b4.addActionListener(new ActionListener() //按照性别查找 { public void actionPerformed(ActionEvent e ) {Sex d= new Sex(); ; Update b=new }); b5.addActionListen } d.setVisible(true)er(new ActionListener() //修改信息 { public void actionPerformed(ActionEvent e ){ Update(); ; b.setVisible(true)} }); b3.addActionListen er(new ActionListener() //按照年龄查找 { public void actionPerformed(ActionEvent e ) { Age f= new Age(); ; }); } } class Create } } }); f.setVisible(true)er(new ActionListener() // 删除指定学生信息 { public void actionPerformed(ActionEvent e ) { Delete c=new Delete(); ; c.setVisible(true)extends JFrame{ //输入信息 收集于网络,如有侵权请联系管理员删除

精品文档

JButton 0); setLocation(400,40OK=new JButton (\确定\ JLabel setDefaultCloseOpea1=new JLabel(\ JLabel ration(JFrame.EXIT_ON_CLOSE); 0); 20); ; 0); 40); t2.setSize(200,20) a2.setSize(50,20); t2.setLocation(50, a2.setLocation(0,4 t1.setSize(200,20) a1.setSize(50,20); t1.setLocation(50, setLayout(null); a1.setLocation(0,2a2=new JLabel(\ JLabel a3=new JLabel(\ JLabel a4=new JLabel(\ JLabel a5=new JLabel(\ JTextField t1=new JTextField(10); JTextField t2=new JTextField(10); JTextField t3=new JTextField(10); JTextField t4=new JTextField(10); JTextField t5=new JTextField(10); super(\学生信息管Create(){ 理系统\ setSize(300,300); 收集于网络,如有侵权请联系管理员删除

精品文档

; 0); 60); ; 0); 80); ; 00); a5.setSize(50,20); a5.setLocation(0,1 t4.setSize(200,20) a4.setSize(50,20); t4.setLocation(50, a4.setLocation(0,8 t3.setSize(200,20) a3.setSize(50,20); t3.setLocation(50, a3.setLocation(0,6 100); ; ; t5.setLocation(50, t5.setSize(200,20) OK.setSize(100,20) OK.setLocation(150,150); add(a1); add(t1); add(a2); add(t2); add(a3); add(t3); add(a4); add(t4); add(a5); add(t5); add(OK); listen2(); } void listen2(){ OK.addActionListener(new ActionListener(){ public 收集于网络,如有侵权请联系管理员删除

青岛理工JAVA实验5资料讲解

精品文档importjavax.swing.JButton;importjava.awt.event.ActionEvent;importjava.awt.event.ActionListener;importjavax.swing.JLabel;importjavax.swing.JPasswordField;importjavax.swing.JOp
推荐度:
点击下载文档文档为doc格式
4r3c64ydj47g2499ip734mu7526k9200fmz
领取福利

微信扫码领取福利

微信扫码分享