(new GridLayout());
add(lab);
add(bu1);
bu1.addActionListener(this);
pack();
show();
}//@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
if(e.getSource()==bu1){
this.dispose();
} }}
(4)
import java.applet.*;
import java.awt.Button;
import java.awt.Container;
import java.awt.GridLayout;
import java.awt.event.*;
import javax.swing.*;
public class zuzhi{
public static void main(String args[])
{
Showwin7 s=new Showwin7();
s.setSize(350,350);
s.setVisible(true);
s.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}});}}
class Showwin7 extends JFrame implements ActionListener
{
JButton but1=new JButton("添加组织信息");
JButton but2=new JButton("删除组织信息");
JButton but4=new JButton("查询组织信息");
JButton but5=new JButton("返回");
Showwin7(){
super("组织信息管理");
Container con=getContentPane();
setLayout(new GridLayout(9,9));
but1.addActionListener(this);
but2.addActionListener(this);
but4.addActionListener(this);
but5.addActionListener(this);
add(but1);
add(but2);
add(but4);
add(but5);
pack();
show();
}//@Override
public void actionPerformed(ActionEvent e) {
Object ob=e.getSource();
if(ob==but1){
this.dispose();
addz q=new addz();
q.setSize(350,350);
}
else if(ob==but2){
this.dispose();
delz w=new delz();
w.setSize(350,350);
}
else if(ob==but4){
this.dispose();
searchz r=new searchz();
r.setSize(350,350);
}
else if(ob==but5){
this.dispose();
showwin t=new showwin();
t.setSize(350,350);
}}}
(5)
import java.applet.*;
import java.awt.Button;
import java.awt.Container;
import java.awt.GridLayout;
import java.awt.event.*;
import javax.swing.*;
public class yonghu{
public static void main(String args[])
{
Showwin5 s=new Showwin5();
s.setSize(350,350);
s.setVisible(true);
s.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}});}}
class Showwin5 extends JFrame implements ActionListener
{
JButton but1=new JButton("添加用户信息");
JButton but2=new JButton("删除用户信息");
JButton but3=new JButton("修改密码");
JButton but4=new JButton("修改用户权限");
JButton but5=new JButton("返回");
Showwin5(){
super("用户信息管理");
setLayout(new GridLayout(9,9));
but1.addActionListener(this);
but2.addActionListener(this);
but3.addActionListener(this);
but4.addActionListener(this);
but5.addActionListener(this);
add(but1);
add(but2);
add(but3);
add(but4);
add(but5);
pack();
show();
}//@Override
public void actionPerformed(ActionEvent e) {
Object ob=e.getSource();
if(ob==but1){
this.dispose();
addy a=new addy();
a.setSize(350,350);
}
else if(ob==but2){
this.dispose();
dely b=new dely();
b.setSize(350,350);
}
else if(ob==but3){
this.dispose();
changemm c=new changemm();
c.setSize(350,350);
}
else if(ob==but4){
this.dispose();
changeq j=new changeq();
j.setSize(350,350);
}
else if(ob==but5){
this.dispose();
showwin f=new showwin();
f.setSize(350,350);
}}}
(6)
import java.applet.*;
import java.awt.Button;
import java.awt.Container;
import java.awt.GridLayout;
import java.awt.event.*;
import javax.swing.*;
public class stuiformation{
public static void main(String args[])
{
Showwin1 s=new Showwin1();
s.setSize(350,350);
s.setVisible(true);
s.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}});}}
class Showwin1 extends JFrame implements ActionListener
{
JButton but1=new JButton("添加学生信息");
JButton but2=new JButton("删除学生信息");
JButton but3=new JButton("修改学生信息");
JButton but4=new JButton("查询学生信息");
JButton but5=new JButton("返回");
Showwin1(){
super("学生信息管理");
setLayout(new GridLayout(9,9));
but1.addActionListener(this);
but2.addActionListener(this);
but3.addActionListener(this);
but4.addActionListener(this);
but5.addActionListener(this);
add(but1);
add(but2);
add(but3);
add(but4);
add(but5);
pack();
show();
}//@Override
public void actionPerformed(ActionEvent e) {
Object ob=e.getSource();
if(ob==but1){
this.dispose();
show1 a=new show1();
a.setSize(350,350);
}
else if(ob==but2){
this.dispose();
show2 o=new show2();
o.setSize(350,350);
}
else if(ob==but3){
this.dispose();
show3 y=new show3();
y.setSize(350,350);
}
else if(ob==but4){
this.dispose();
show4 f=new show4();
f.setSize(350,350);
}
else if(ob==but5){
this.dispose();
showwin h=new showwin();
h.setSize(350,350);
}}}
(7)
import java.awt.GridLayout;
import java.awt.List;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.swing.JButton;
import javax.swing.JFrame;
public class seestuID {
public static void main(String args[])
{
show4 s=new show4();
s.setSize(350,350);
s.setVisible(true);
s.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}});}}
class show4 extends JFrame implements ActionListener
{
List lis1=new List();
JButton but5=new JButton("返回");
show4(){
super("查询结果");
setLayout(new GridLayout(2,1));
but5.addActionListener(this);
add(lis1);
add(but5);
try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
String url = "jdbc:sqlserver://localhost:1433;databasename=课程设计";
Connection conn = DriverManager.getConnection(url,"sa","123456");
Statement stm = conn.createStatement();
String sql = "select * from 学生信息";
ResultSet res = stm.executeQuery(sql); //执行Sql语句获取查询结果集
while(res.next()){
String a=res.getString("");
String b=res.getString("");
String c=res.getString("性别");
String d=res.getString("出生日期");
String e=res.getString("籍贯");
String f=res.getString("民族");
String g=res.getString("班级");
lis1.add(a+" "+b+" "+c+" "+d+" "+e+" "+f+" "+g);
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
pack();
show();
}//@Override
上一篇:
BBS论坛系统毕业设计说明书
下一篇:
电信运营支持系统的设计与开发毕业论文