⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 customerregist.java

📁 存款、取款、账户明细、系统备份、修改密码
💻 JAVA
字号:
package customer.services.frame;

import java.awt.Font;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;

import database.regist.impl.RegistImpl;

import DBManager.SQLserver2000;
import MainFrame.Login;
import MainFrame.MainFrame;
import MainFrame.MyFrame;
import admin.services.action.AdminAction;

public class CustomerRegist extends MyFrame implements ActionListener {


	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JLabel username;
	private JTextField usernameText;
	private JLabel password;
	private JTextField passwordText;
	private JLabel IDcard;
	private JTextField IDcardText;
	private JButton ok;
	public CustomerRegist(MainFrame m) {
		super(m);
		initialize(m.getTitle());
	}
	
	private void initialize(String title) {
		username =  new JLabel();
		username.setText("姓名:");
		username.setFont(new Font("黑体",Font.BOLD,20));
		username.setBounds(new Rectangle(15, 15, 200, 100));
		
		usernameText = new JTextField();
		usernameText.setBounds(new Rectangle(115, 50, 100, 27));
		
		
		password =  new JLabel();
		password.setText("密码:");
		password.setFont(new Font("黑体",Font.BOLD,20));
		password.setBounds(new Rectangle(15, 155, 200, 100));
		
		passwordText = new JTextField();
		passwordText.setBounds(new Rectangle(115, 190, 100, 27));
		
		IDcard = new JLabel();
		IDcard.setText("身份证号:");
		IDcard.setFont(new Font("黑体",Font.BOLD,20));
		IDcard.setBounds(new Rectangle(15, 295, 200, 100));
		
		IDcardText = new JTextField();
		IDcardText.setBounds(new Rectangle(115, 330, 150, 27));
		
		
		ok = new JButton();
		ok.setText("注册用户?");
		//ok.setFont(new Font("黑体",Font.BOLD,20));
		ok.setBounds(new Rectangle(380, 335, 130, 30));
		ok.addActionListener(this);
		this.add(username);
		this.add(usernameText);
		this.add(password);
		this.add(passwordText);
		this.add(IDcard);
		this.add(IDcardText);
		this.add(ok);
		this.setTitle(title);
		this.setBounds(300,200,520,390);
	}
	public static void main(String[] args) {
		
	}

	public void actionPerformed(ActionEvent e) {
		if(e.getSource() == ok){
			String CustomerName = usernameText.getText();
			String CustomerPassword = passwordText.getText();
			String CustomerIDcard = IDcardText.getText();
			boolean result =  new RegistImpl().regist("普通用户", CustomerName, CustomerPassword, CustomerIDcard);
			if(result == true ){
				JOptionPane.showMessageDialog(this, "添加用户成功");
				return;
			}else{
				JOptionPane.showMessageDialog(this, "身份证已被注册");
				return;
			}
		}
			if(m!=null)
			m.setVisible(true);
			dispose();
			SQLserver2000.closeDB();
		
	}
		}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -