1 / 13
文档名称:

JAVA课程设计源程序.docx

格式:docx   大小:44KB   页数:13页
下载后只包含 1 个 DOCX 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

JAVA课程设计源程序.docx

上传人:xunlai783 2018/1/7 文件大小:44 KB

下载得到文件列表

JAVA课程设计源程序.docx

相关文档

文档介绍

文档介绍:package javabigwork;
import .*;
import .*;
import .*;
import .*;
public class LoginFrm extends JFrame implements ActionListener{
private JLabel lblTitle=new JLabel("欢迎进入家庭财务管理系统");
private JLabel lblName=new JLabel("用户名");
private JLabel lblPwd=new JLabel("密码");
private JTextField txtName=new JTextField();
private JPasswordField txtPwd=new JPasswordField();
private JButton btnOk=new JButton("用户登陆");
private JButton btnCancel=new JButton("退出系统");
private String driver = "";
private String url = "jdbc:odbc:mydb";
private int rowcount=0;
public LoginFrm(){
JPanel jp = (JPanel) ();
(null);
(lblTitle);
(300, 50, 200, 50);
(lblName);(200, 100, 100, 20);
(txtName);(500, 100, 100, 20);
(lblPwd);(200, 150, 100, 20);
(txtPwd);(500, 150, 100, 20);
(btnOk);(200, 220, 100, 20);
(btnCancel);(500, 220, 100, 20);
("家庭用户登陆");
(800,400);
(true);
(EXIT_ON_CLOSE);
(this);
(this);
}
public void actionPerformed(ActionEvent e) {
if(() == btnOk){
String [][] rows = ();
String s1=();
String s2=();
for(int i=0;i<rowcount;i++){
if((rows[i][0])){
if((rows[i][1])){
(this, "用户名和密码正确
");
new CustomerFrm();
}
else
(this, "用户名或密码错误");
}
}
}
if(() == btnCancel){
(0);
}
}
public String[][] queryCustomers() {
String[][] rows = null;
try {
(driver);
Connection con = (url);
Statement cmd = ();
String sql