?? 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 + -