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