📄 bushan.java
字号:
package sun.BuMenXiaoShou;
import cn.KeKuXiaoShao.*;
import com.yonghuxiaoshou.*;
import deng.shaoxiao.*;
import sn.ChangPingXiaoShou.*;
import xiao.xiaoshouxiaoshou.*;
import yuan.xiaoshou.*;
//部门删除类
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class BuShan {
JFrame jf ;
JTextField jtf;
public BuShan(){
jf = new JFrame();
Container cont = jf.getContentPane();
cont.setLayout(null);
Font f = new Font("新宋体",1,15);
jf.setTitle("欢迎进入部门删除信息框");
jf.setForeground(Color.red);
jf.setFont(f);
JLabel jl = new JLabel("请输入你要删除的p_id");
jl.setForeground(Color.red);
jl.setBounds(60,10,210,20);
jl.setFont(f);
JLabel jl1 = new JLabel("部门编号");
jl1.setForeground(Color.blue);
jl1.setBounds(20,40,80,20);
jl1.setFont(f);
jtf = new JTextField(20);
jtf.setForeground(Color.blue);
jtf.setBounds(110,40,160,20);
jtf.setFont(f);
JButton jb = new JButton("确定");
jb.setForeground(Color.blue);
jb.setBounds(30,80,70,30);
jb.setFont(f);
JButton jb1 = new JButton("取消");
jb1.setForeground(Color.blue);
jb1.setBounds(110,80,70,30);
jb1.setFont(f);
JButton jb2 = new JButton("后退");
jb2.setForeground(Color.blue);
jb2.setBounds(190,80,70,30);
jb2.setFont(f);
jf.setBounds(400,300,300,150);
cont.add(jl);
cont.add(jl1);
cont.add(jtf);
cont.add(jb);
cont.add(jb1);
cont.add(jb2);
//添加事件
jb.addActionListener(new queding());
jb1.addActionListener(new quxiao());
jb2.addActionListener(new tuihou());
ImageIcon image = new ImageIcon("e:\\大一项目\\产品销售管理系统\\button1.jpg");
jf.setIconImage(image.getImage());
jf.setUndecorated(true);
jf.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
jf.setVisible(true);
jf.setResizable(false);
}
//添加确定按钮事件
class queding implements ActionListener{
public void actionPerformed(ActionEvent e){
BuLian bl = new BuLian();
bl.delete(Integer.parseInt(jtf.getText()));
jf.setVisible(false);
jf.disable();
}
}
//添加取消按钮事件
class quxiao implements ActionListener{
public void actionPerformed(ActionEvent e){
jtf.setText("");
jtf.grabFocus();
}
}
//添加退后的按钮事件
class tuihou implements ActionListener{
public void actionPerformed(ActionEvent e){
jf.setVisible(false);
jf.disable();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -