📄 button_delete.java
字号:
/*
* @(#)Database.java 1.0 06/06/23
* @作者:林宝尉
*/
package myprojects.ButtonsAction;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import myprojects.ButtonsAction.*;
public class Button_Delete
{
JFrame f=new JFrame();
JButton button_Student;
JButton button_Teacher;
JTextField textfield_1;
JTextField textfield_2;
Object[] options={"确定"};
Container c=f.getContentPane();
GridBagLayout gbLayoutObj;
GridBagConstraints gbcObj;
public Button_Delete()
{
Container c=f.getContentPane();
GridBagLayout gbLayoutObj;
GridBagConstraints gbcObj;
gbLayoutObj=new GridBagLayout();
gbcObj=new GridBagConstraints();
c.setLayout(gbLayoutObj);
c.setBackground(Color.cyan);
FlowLayout flayout;
flayout=new FlowLayout(FlowLayout.RIGHT,0,0);
JLabel label_wel=new JLabel("学籍管理系统");
Font ft=new Font("宋体",Font.BOLD,26);
label_wel.setFont(ft);
gbcObj.anchor=GridBagConstraints.WEST;
gbcObj.gridx=0;
gbcObj.gridy=0;
gbLayoutObj.setConstraints(label_wel,gbcObj);
c.add(label_wel);
JLabel label_we=new JLabel("----基本信息删除");
Font ftt=new Font("隶书",Font.BOLD,24);
label_we.setFont(ftt);
gbcObj.anchor=GridBagConstraints.WEST;
gbcObj.gridx=0;
gbcObj.gridy=1;
gbLayoutObj.setConstraints(label_we,gbcObj);
c.add(label_we);
button_Student=new JButton("学生基本信息删除");
gbcObj.anchor=GridBagConstraints.WEST;
gbcObj.gridx=0;
gbcObj.gridy=2;
gbLayoutObj.setConstraints(button_Student,gbcObj);
c.add(button_Student);
button_Student.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent asd)
{
String str1=new String("点击确定进入。");
JOptionPane.showOptionDialog(null,str1,
"提示!",JOptionPane.DEFAULT_OPTION,
JOptionPane.WARNING_MESSAGE,null,options,
options[0]);
new Delete_Student();
return;
}});
button_Teacher=new JButton("教师基本信息删除");
gbcObj.anchor=GridBagConstraints.WEST;
gbcObj.gridx=0;
gbcObj.gridy=3;
gbLayoutObj.setConstraints(button_Teacher,gbcObj);
c.add(button_Teacher);
button_Teacher.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent asd)
{
String str1=new String("点击确定进入。");
JOptionPane.showOptionDialog(null,str1,
"提示!",JOptionPane.DEFAULT_OPTION,
JOptionPane.WARNING_MESSAGE,null,options,
options[0]);
new Delete_Teacher();
return;
}});
f.setSize(400,400);
f.setTitle("Button_Delete");
f.setBounds(200,200,500,500);
f.setVisible(true);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -