📄 panelfordelete_1.java
字号:
package E4;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.Vector;
import java.io.File;
import java.io.*;
import java.util.StringTokenizer;
import javax.swing.table.*;
import java.sql.*;
//显示信息
class Delete_1 implements ActionListener
{
JDialog jfm;
JTabbedPane jplForFrame=new JTabbedPane();
JLabel tell=new JLabel("删除学籍",JLabel.CENTER);
panelForDeletePerson_1 pDelePer;
panelForDeleteClass_1 pDeleCla;
panelForDeleteCollege_1 pDeleCol;
panelForDeleteAll_1 pDeleAll;
Delete_1(JFrame f,String s,boolean b)
{
jfm=new JDialog(f,s,b);
jfm.setSize(410,220);
jfm.setBackground(Color.white);
pDelePer = new panelForDeletePerson_1(f,b);
pDeleCla = new panelForDeleteClass_1(f,b);
pDeleCol = new panelForDeleteCollege_1(f,b);
pDeleAll = new panelForDeleteAll_1(f,b);
jfm.addWindowListener(new WindowAdapter()
{public void windowClosing(WindowEvent e)
{
jfm.setVisible(false);
}});
jfm.setResizable(false);
jplForFrame.setBackground(Color.white);
jplForFrame.addTab("删除个人信息",pDelePer);
jplForFrame.addTab("删除班级信息",pDeleCla);
jplForFrame.addTab("删除院系信息",pDeleCol);
jplForFrame.addTab("删除全部信息",pDeleAll);
pDelePer.cancel.addActionListener(this);
pDeleCla.cancel.addActionListener(this);
pDeleCol.cancel.addActionListener(this);
pDeleAll.cancel.addActionListener(this);
jfm.setLayout(new BorderLayout(9,9));
jfm.add(jplForFrame);
tell.setBackground(Color.BLACK);
jfm.add(tell,BorderLayout.NORTH);
}
public void actionPerformed(ActionEvent e){
if(e.getSource()==pDelePer.cancel){
this.setDisplay(false);
}
else if(e.getSource()==pDeleCla.cancel){
this.setDisplay(false);
}
else if(e.getSource()==pDeleCol.cancel){
this.setDisplay(false);
}
else if(e.getSource()==pDeleAll.cancel){
this.setDisplay(false);
}
}
void setDisplay(Boolean tf){
jfm.setVisible(tf);
}
}
class panelForDeletePerson_1 extends JPanel implements ActionListener
{
// framForSearch ffs;//查找界面
JPanel contentPane_1,contentPane_3;
JLabel du_id=new JLabel("输入学号",JLabel.CENTER);
JTextField jf_id=new JTextField("",8);
JButton handin = new JButton("提交");
JButton find =new JButton("查找");
JButton cancel = new JButton("退出");
proceeSQL psql=new proceeSQL();
panelForDeletePerson_1(JFrame f,boolean b){
// ffs = new framForSearch(f,"查找用户信息",b);
contentPane_1=new JPanel();
contentPane_3=new JPanel();
contentPane_1.setLayout(new FlowLayout(FlowLayout.CENTER,10,10));
contentPane_1.add(du_id);
contentPane_1.add(jf_id);
contentPane_1.add(find);
contentPane_3.setLayout(new FlowLayout(FlowLayout.CENTER));
contentPane_3.add(handin);
contentPane_3.add(cancel);
// contentPane_3.setLayout(new GridLayout(2,1,9,9));
// handin.addActionListener(this);
cancel.addActionListener(this);
super.setLayout(new BorderLayout(9,9));
super.add(new JLabel("按学号删除个人信息",JLabel.CENTER),BorderLayout.NORTH);
super.add(contentPane_1);
super.add(contentPane_3,BorderLayout.SOUTH);;
}
public void actionPerformed(ActionEvent e){
if(e.getSource()==cancel){
}
}
}
class panelForDeleteClass_1 extends JPanel implements ActionListener,ItemListener
{
// framForSearch ffs;//查找界面
JPanel contentPane_1,contentPane_3;
Choice college = new Choice();
Choice classes = new Choice();
JButton handin = new JButton("提交");
JButton cancel = new JButton("退出");
proceeSQL psql=new proceeSQL();
panelForDeleteClass_1(JFrame f,boolean b){
// ffs = new framForSearch(f,"查找用户信息",b);
contentPane_1=new JPanel();
contentPane_3=new JPanel();
//计算机科学与技术,网络工程,软件工程,会计学,国际贸易,光电子,机械自动化,环境工程
college.addItem("计算机科学与技术");
college.addItem("网络工程");
college.addItem("软件工程");
college.addItem("会计学");
college.addItem("国际贸易");
college.addItem("光电子");
college.addItem("机械自动化");
college.addItem("环境工程");
for(int i=3;i<7;i++)
for(int j=0;j<4;j++)
classes.addItem("计算机科学与技术0"+i+(j+1)+"班");
contentPane_1.add(new JLabel("选择院系:",JLabel.CENTER));
contentPane_1.add(college);
contentPane_1.add(new JLabel("选择班级:",JLabel.CENTER));
contentPane_1.add(classes);
contentPane_1.setLayout(new GridLayout(2,2,9,9));
contentPane_3.setLayout(new FlowLayout(FlowLayout.CENTER));
contentPane_3.add(handin);
contentPane_3.add(cancel);
college.addItemListener(this);
handin.addActionListener(this);
cancel.addActionListener(this);
super.setLayout(new BorderLayout(9,9));
super.add(new JLabel("按班级删除学生学籍",JLabel.CENTER),BorderLayout.NORTH);
super.add(contentPane_1);
super.add(contentPane_3,BorderLayout.SOUTH);;
}
public void itemStateChanged(ItemEvent e){
if(e.getItemSelectable()==college){
addIntoClasses(college.getSelectedItem());
}
}
void addIntoClasses(String college){
classes.removeAll();
for(int i=3;i<7;i++)
for(int j=0;j<4;j++)
classes.addItem(college+"0"+i+(j+1)+"班");
}
public void actionPerformed(ActionEvent e){
if(e.getSource()==cancel){
}
}
}
class panelForDeleteCollege_1 extends JPanel implements ActionListener
{
// framForSearch ffs;//查找界面
JPanel contentPane_1,contentPane_3;
Choice college = new Choice();
JButton handin = new JButton("提交");
JButton cancel = new JButton("退出");
proceeSQL psql=new proceeSQL();
panelForDeleteCollege_1(JFrame f,boolean b){
// ffs = new framForSearch(f,"查找用户信息",b);
contentPane_1=new JPanel();
contentPane_3=new JPanel();
college.addItem("计算机科学与技术");
college.addItem("网络工程");
college.addItem("软件工程");
college.addItem("会计学");
college.addItem("国际贸易");
college.addItem("光电子");
college.addItem("机械自动化");
college.addItem("环境工程");
contentPane_1.setLayout(new FlowLayout(FlowLayout.CENTER,10,10));
contentPane_1.add(new JLabel("选择院系:",JLabel.CENTER));
contentPane_1.add(college);
contentPane_3.setLayout(new FlowLayout(FlowLayout.CENTER));
contentPane_3.add(handin);
contentPane_3.add(cancel);
handin.addActionListener(this);
cancel.addActionListener(this);
super.setLayout(new BorderLayout(9,9));
super.add(new JLabel("按院系删除学生学籍",JLabel.CENTER),BorderLayout.NORTH);
super.add(contentPane_1);
super.add(contentPane_3,BorderLayout.SOUTH);;
}
public void actionPerformed(ActionEvent e){
if(e.getSource()==cancel){
}
}
}
class panelForDeleteAll_1 extends JPanel implements ActionListener
{
// framForSearch ffs;//查找界面
JPanel contentPane_1,contentPane_3;
JButton handin = new JButton("提交");
JButton cancel = new JButton("退出");
proceeSQL psql=new proceeSQL();
panelForDeleteAll_1(JFrame f,boolean b){
contentPane_1=new JPanel();
contentPane_3=new JPanel();
contentPane_1.setLayout(new FlowLayout(FlowLayout.CENTER));
contentPane_1.add(handin);
contentPane_1.add(cancel);
contentPane_3.add(new JLabel("一失足成千古恨,君请三思",JLabel.CENTER));
handin.addActionListener(this);
cancel.addActionListener(this);
super.setLayout(new BorderLayout(9,9));
super.add(new JLabel("删除全部学生学籍",JLabel.CENTER),BorderLayout.NORTH);
super.add(contentPane_3);
super.add(contentPane_1,BorderLayout.SOUTH);;
}
public void actionPerformed(ActionEvent e){
if(e.getSource()==cancel){
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -