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

📄 petregister.java

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

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

public	class PetRegister{
	
    public static JFrame frame;
	public static JTable BTCK;                    //表格
	public static JButton BAdd,BDel, BBack;       //增加 删除 返回 按钮
	public static int Mess;
	JLabel LTitle;                                  //标题 标签
	public RegisterGet Reget;
	
	public PetRegister(){
		
	    frame=new JFrame();                         //设置窗体
		frame.setBounds(180, 100, 740, 500);         
		frame.setResizable(false);                                        
		frame.setLayout(null);  
		frame.setTitle("宠物登记");
		frame.validate();
		
		new PetCommon();
		
		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 ChangePet();
					ChangePetGet.GetText();
					frame.dispose();
				}
			}
			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);
		BAdd.addActionListener(new ActionListener(){                      //增加按钮事件监听器

			public void actionPerformed(ActionEvent arg0) {
				
				frame.dispose();
				new NewPet();
			}
			
		});
		
		frame.add(BDel);    
		BDel.addActionListener(new ActionListener(){                     //删除按钮事件监听器

			public void actionPerformed(ActionEvent arg0) {
				
				Mess=JOptionPane.showConfirmDialog(null, "确认是否删除所选信息?", "系统信息提示", JOptionPane.YES_NO_OPTION);
				
				if(Mess==JOptionPane.YES_OPTION){
					
					new DeletePet();
				}
			}
		});
		
		frame.add(BBack);
		BBack.addActionListener(new ActionListener(){                    //返回按钮事件监听器

			public void actionPerformed(ActionEvent arg0) {
						
				frame.dispose();		
			}		
		});		
		
		frame.add(LTitle);
		frame.add(JSPane);
		
		frame.setVisible(true);
			
	}
	
}

⌨️ 快捷键说明

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