没有合适的资源?快使用搜索试试~ 我知道了~
企业工资管理系统JavaMySQL样本.doc
1 下载量 33 浏览量
2023-08-03
23:11:13
上传
评论 1
收藏 142KB DOC 举报
温馨提示
试读
42页
企业工资管理系统JavaMySQL样本.doc
资源推荐
资源详情
资源评论
资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。
企业工资管理系统( MySQL+Java)
本代码仅供初学者参考使用, 相互学习, 共同进步, 让优秀成为一种习惯。
软件下载:
开发语言: Java
开发工具: eclipse
数据库软件: MySQL
数据库驱动: mysql-connector-java-5.1.6-bin
驱动下载地址:
以下是代码和界面截图, 共 7 个类。
1. DB1 欢迎界面
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class DB1 extends JFrame implements ActionListener {
private static final long serialVersionUID = 1L;
JFrame frame = new JFrame("欢迎进入工资管理系统");
JLabel label = new JLabel("", JLabel.CENTER);
资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。
JButton button1 = new JButton("进入系统");
JButton button2 = new JButton("退出系统");
void Create() {
JPanel pcontentPane = (JPanel) frame.getContentPane();
pcontentPane.add(label);
pcontentPane.setLayout(new FlowLayout());
pcontentPane.add(button1);
pcontentPane.add(button2);
pcontentPane.setBackground(Color.gray);
pcontentPane.setVisible(true);
button1.addActionListener(this);
button2.addActionListener(this);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setBounds(500, 300, 300, 150);
frame.setResizable(false);
frame.setVisible(true);
}
public static void main(String[] args) {
DB1 dome = new DB1();
dome.Create();
资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。
}
public void actionPerformed(ActionEvent e) {
if (button1.equals(e.getSource())) {
DL dl = new DL();
dl.create();
frame.dispose();
}
if (button2.equals(e.getSource())) {// 退出
System.exit(0);
}
}
}
1. DL 登陆界面
import java.awt.Color;
import java.awt.FlowLayout;
资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
import com.mysql.jdbc.PreparedStatement;
@SuppressWarnings("serial")
class DL extends JFrame implements ActionListener
{
JFrame frame = new JFrame("职工/管理员登陆");
JLabel label1 = new JLabel("用户名");
JLabel label2 = new JLabel("密码");
JButton logonButton1 = new JButton("管理员登录");
资料内容仅供您学习参考,如有不当或者侵权,请联系改正或者删除。
JButton logonButton2 = new JButton("职工登录");
JButton cancelButton = new JButton("退出");
JTextField username = new JTextField(9);
JPasswordField password = new JPasswordField(9);
static String t1;
static String t2;
void create()
{
JPanel p = (JPanel) frame.getContentPane();
@SuppressWarnings("unused")
JPanel p1 = new JPanel();
p.setLayout(new FlowLayout());
p.add(label1);
p.setSize(5, 5);
p.setLocation(4, 8);
p.add(username);
p.setSize(100, 200);
p.setLocation(800, 800);
p.add(label2);
p.setSize(50, 20);
p.setLocation(40, 80);
p.add(password);
剩余41页未读,继续阅读
资源评论
智慧安全方案
- 粉丝: 3699
- 资源: 59万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功