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

📄 usermanager.java

📁 宠物医院管理系统 包含宠物的注册 管理 收费 诊断等一系列过程控制 还包含配应的数据库 Jar包
💻 JAVA
字号:
package yd.pethosptial.usermanager.view;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import yd.pethospital.usermanager.jdbc.*;

public	class UserManager {
		
	public static JFrame frame;
	public static JTable BTCK;                    //表格
	public static JButton BAdd,BDel, BBack;       //增加 删除 返回 按钮
	public static int Mess;
	JLabel LTitle;                                 //标题 标签
	public RegisterGet Reget;
	
	public UserManager(){                       
		
		frame=new JFrame();                            //设置窗体
		frame.setBounds(240, 100, 740, 500);           //位置 大小 不可改变大小 空布局 标题
		frame.setResizable(false); 
		frame.setTitle("用户管理");
		frame.setLayout(null);           
		frame.validate();
		
		LTitle=new JLabel("用户管理");                          //设置标题标签  
		LTitle.setFont(new Font(null,Font.TYPE1_FONT,28));     
		LTitle.setBounds(330,15,120,40);                          
		
		Reget=new RegisterGet();
		BTCK=new JTable(Reget);                                 //创建 设置表格
		JScrollPane JSPane=new JScrollPane(BTCK);           
		JSPane.setBounds(80,50,600,360);     
		BTCK.setVisible(true);
		
		BTCK.addMouseListener(new MouseListener(){              //添加表格的监听器

			public void mouseClicked(MouseEvent e) {
				
				if(e.getClickCount()==2){                       //双击表格事件
					
					new ChangeUser();
					frame.dispose();
					ChangeUserGet.GetText();
				}
			}

			public void mouseEntered(MouseEvent arg0) {}
			public void mouseExited(MouseEvent arg0) {}
			public void mousePressed(MouseEvent arg0) {}
			public void mouseReleased(MouseEvent arg0) {}			
			
		});            
		
		BAdd=new JButton("新增");                          
		BDel=new JButton("删除");
		BBack=new JButton("返回");
		                                                   
		BAdd.setBounds(160,420,70,30);
		BAdd.setFont(new Font(null,Font.BOLD,14));
		
		BDel.setBounds(320,420,70,30);
		BDel.setFont(new Font(null,Font.BOLD,14));
		
		BBack.setBounds(480,420,70,30);
		BBack.setFont(new Font(null,Font.BOLD,14));
		
		frame.add(BAdd);
		frame.add(BDel);                                    
		frame.add(BBack);
		
		BAdd.addActionListener(new ActionListener(){                        //添加新增按钮 监听器

			public void actionPerformed(ActionEvent arg0) {
				
				UserManager.frame.dispose();
				new NewUser();
			}
		});
		
		BBack.addActionListener(new ActionListener(){                       //添加删除按钮 监听器

			public void actionPerformed(ActionEvent arg0) {
						
				frame.dispose();		
			}		
		});		
					
		BDel.addActionListener(new ActionListener(){                        //添加返回 监听器

			public void actionPerformed(ActionEvent arg0) {

				Mess=JOptionPane.showConfirmDialog(null, "确认是否删除所选信息?", "系统信息提示", JOptionPane.YES_NO_OPTION);
				
				if(Mess==JOptionPane.YES_OPTION){
					new DeleteUser();
				}
			}		
		});
		    
		JSPane.setBounds(80,50,600,360);                       
		
		frame.add(LTitle);  
		frame.add(JSPane);                                     
		
		frame.setVisible(true); 	
		
	}
	
}

⌨️ 快捷键说明

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