简单的员工信息查询java程序

更新时间:2023-06-08 20:19:28 阅读: 评论:0

import java.awt.event.ActionListener;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.sql.*;
public class Employee extends JFrame implements ActionListener{
    String titles[]={"工号:","姓名:","性别:","出生日期:","联系电话:","家庭住址:","个人情况:"};
    JTextField employeeID=new JTextField(8);
    JTextField employeeName=new JTextField(8);
    JTextField employeeSex=new JTextField(2);
    JTextField employeeBirthday=new JTextField(6);
    JTextField employeePhone=new JTextField(11);
    JTextField employeeAddress=new JTextField(20);
    JTextArea employeeResume=new JTextArea();
    JButton first=new JButton("首页");
    JButton next=new JButton("下一条");
campagnolo    JButton previous=new JButton("上一条");
    JButton last=new JButton("尾页");
男生服装搭配的技巧
达内ui设计培训学院    Statement stmt;
    ResultSet rs;
    Employee(){
        super("员工信息查询");
        tSize(350,330);
        try{
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            Connection Connection("jdbc:odbc:mydb","sa","123");
            ateStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
            uteQuery("lect * from mdb");
            getContentPane().tLayout(new BorderLayout(0,8));
            JPanel p[]=new JPanel[6];
            for(int i=0;i<6;i++){
                p[i]=new JPanel(new FlowLayout(FlowLayout.LEFT,10,0));
                p[i].add(new JLabel(titles[i]));
            }
            p[0].add(employeeID);
            p[1].add(employeeName);tradeoff
            p[2].add(employeeSex);
            p[3].add(employeeBirthday);
guidebook            p[4].add(employeePhone);
            p[5].add(employeeAddress);
            JPanel p1=new JPanel(new GridLayout(6,1,0,8));
            JScrollPane jsp=new JScrollPane(employeeResume,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
            jsp.tPreferredSize(new Dimension(250,80));
            for(int i=0;i<6;i++)
            p1.add(p[i]);
            JPanel p2=new JPanel (new FlowLayout(FlowLayout.LEFT,10,0));
tremme            p2.add(new JLabel(titles[6]));
            p2.add(jsp);
            JPanel p3=new JPanel();
            p3.add(first);永远相伴
            p3.add(previous);
            p3.add(next);
            p3.add(last);
            getContentPane().add(p1,"North");
            getContentPane().add(p2,"Center");
            getContentPane().add(p3,"South");
            next.addActionListener(this);
            previous.addActionListener(this);
            first.addActionListener(this);
            last.addActionListener(this);
            rs.first();
            display();
            }catch(Exception e){e.printStackTrace();}
        tVisible(true);
        }
莫言小说蛙
    public void actionPerformed(ActionEvent e){
        try{
            if (e.getSource()==();
            el Source()==previous)rs.previous();
            el if (e.getSource()==first)rs.first();
            el Source()==last)rs.last();
电影 推荐
            display();
        }catch(Exception ee){ee.printStackTrace();}
       
    }
    boolean display(){
        try{
            employeeID.String("employeeID"));
            employeeName.String("employeeName"));
            employeeSex.String("employeeSex"));
            employeeBirthday.String("employeeBirthday"));
            employeePhone.String("employeePhone"));
            employeeAddress.String("employeeAddress"));
            employeeResume.String("employeeResume"));
        }catch(SQLException e){e.printStackTrace();return fal;}
        return true;
    }
   
    public static void main(String[] args) {
        JFrame.tDefaultLookAndFeelDecorated(true);
        Employee em=new Employee();
    }
}

本文发布于:2023-06-08 20:19:28,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/78/905287.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:男生   设计   查询   家庭   情况
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图