📄 checkdialog.java
字号:
package studentinfosystem.zhouzijie;
import java.awt.*;
import javax.swing.*;
import com.borland.dbswing.JdbTextField;
import java.awt.Rectangle;
import com.borland.dbswing.JdbRadioButton;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* <p>Title: 学生管理信息系统</p>
*
* <p>Description: 学生管理信息系统数据版本</p>
*
* <p>Copyright: Copyright (c) 2007</p>
*
* <p>Company: 广东工业大学</p>
*
* @author 周子杰
* @version 1.0
*/
public class CheckDialog extends JDialog {
JdbTextField jdbTextField1 = new JdbTextField();
JdbTextField jdbTextField2 = new JdbTextField();
JdbRadioButton jdbRadioButton1 = new JdbRadioButton();
JdbRadioButton jdbRadioButton2 = new JdbRadioButton();
JdbTextField jdbTextField3 = new JdbTextField();
JdbTextField jdbTextField4 = new JdbTextField();
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
JLabel jLabel3 = new JLabel();
JLabel jLabel4 = new JLabel();
JLabel jLabel5 = new JLabel();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
JButton jButton3 = new JButton();
JButton jButton4 = new JButton();
JButton jButton5 = new JButton();
JButton jButton6 = new JButton();
public CheckDialog(Frame owner, String title, boolean modal) {
super(owner, title, modal);
try {
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
jbInit();
pack();
} catch (Exception exception) {
exception.printStackTrace();
}
}
public CheckDialog() {
this(MainFrame.mainframe, "CheckDialog", true);
}
private void jbInit() throws Exception {
this.getContentPane().setLayout(null);
ButtonGroup bg=new ButtonGroup() ;
jdbTextField1.setColumnName("sno");
jdbTextField1.setBounds(new Rectangle(96, 19, 194, 20));
jdbTextField2.setColumnName("name");
jdbTextField2.setBounds(new Rectangle(96, 46, 193, 20));
jdbRadioButton1.setText("男");
jdbRadioButton1.setBounds(new Rectangle(104, 72, 53, 23));
jdbRadioButton2.setText("女");
jdbRadioButton2.setBounds(new Rectangle(159, 72, 73, 23));
jdbTextField3.setColumnName("birthday");
jdbTextField3.setBounds(new Rectangle(96, 101, 193, 20));
jdbTextField4.setColumnName("department");
jdbTextField4.setBounds(new Rectangle(96, 136, 193, 20));
jLabel1.setText("学号:");
jLabel1.setBounds(new Rectangle(36, 20, 85, 15));
jLabel2.setText("姓名:");
jLabel2.setBounds(new Rectangle(36, 47, 42, 15));
jLabel3.setText("性别:");
jLabel3.setBounds(new Rectangle(36, 76, 57, 15));
jLabel4.setText("出生年月:");
jLabel4.setBounds(new Rectangle(36, 104, 82, 15));
jLabel5.setText("院系名称:");
jLabel5.setBounds(new Rectangle(36, 137, 81, 15));
jdbTextField1.setDataSet(MainFrame.queryDataSet1);
jdbTextField2.setDataSet(MainFrame.queryDataSet1);
jdbTextField3.setDataSet(MainFrame.queryDataSet1);
jdbTextField4.setDataSet(MainFrame.queryDataSet1);
jdbRadioButton1.setDataSet(MainFrame.queryDataSet1);
jdbRadioButton2.setDataSet(MainFrame.queryDataSet1);
this.setTitle("查询数据-卡片形式");
jdbRadioButton1.setButtonGroup(bg);
jdbRadioButton2.setButtonGroup(bg);
jdbRadioButton1.setColumnName("sex");
jdbRadioButton2.setColumnName("sex");
jdbRadioButton1.setSelectedDataValue("男");
jdbRadioButton2.setSelectedDataValue("女");
jButton1.setBounds(new Rectangle(31, 175, 81, 23));
jButton1.setText("首条");
jButton1.addActionListener(new CheckDialog_jButton1_actionAdapter(this));
jButton2.setBounds(new Rectangle(116, 175, 81, 23));
jButton2.setText("上一条");
jButton2.addActionListener(new CheckDialog_jButton2_actionAdapter(this));
jButton3.setBounds(new Rectangle(203, 175, 81, 23));
jButton3.setText("下一条");
jButton3.addActionListener(new CheckDialog_jButton3_actionAdapter(this));
jButton4.setBounds(new Rectangle(288, 175, 81, 23));
jButton4.setText("尾条");
jButton4.addActionListener(new CheckDialog_jButton4_actionAdapter(this));
jButton5.setBounds(new Rectangle(99, 217, 81, 23));
jButton5.setText("修改");
jButton5.addActionListener(new CheckDialog_jButton5_actionAdapter(this));
jButton6.setBounds(new Rectangle(214, 217, 81, 23));
jButton6.setText("取消");
jButton6.addActionListener(new CheckDialog_jButton6_actionAdapter(this));
this.getContentPane().add(jLabel1);
this.getContentPane().add(jLabel2);
this.getContentPane().add(jLabel3);
this.getContentPane().add(jLabel4);
this.getContentPane().add(jLabel5);
this.getContentPane().add(jdbTextField3);
this.getContentPane().add(jdbTextField4);
this.getContentPane().add(jdbTextField1);
this.getContentPane().add(jdbTextField2);
this.getContentPane().add(jdbRadioButton1);
this.getContentPane().add(jdbRadioButton2);
this.getContentPane().add(jButton2);
this.getContentPane().add(jButton1);
this.getContentPane().add(jButton3);
this.getContentPane().add(jButton4);
this.getContentPane().add(jButton5);
this.getContentPane().add(jButton6);
this.setSize(400,300);
Dimension sreenSize=Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize=this.getSize();
if(frameSize.height>sreenSize.width){
frameSize.height = sreenSize.height;
}
if(frameSize.width>sreenSize.width){
frameSize.width=sreenSize.width;
}
this.setLocation((sreenSize.width-frameSize.width)/2,
(sreenSize.height-frameSize.height)/2);
this.setVisible(true);
}
//首条记录
public void jButton1_actionPerformed(ActionEvent e) {
MainFrame.queryDataSet1.first();
}
public void jButton2_actionPerformed(ActionEvent e) {
MainFrame.queryDataSet1.prior();
}
public void jButton3_actionPerformed(ActionEvent e) {
MainFrame.queryDataSet1.next();
}
public void jButton4_actionPerformed(ActionEvent e) {
MainFrame.queryDataSet1.last();
}
//修改保存
public void jButton5_actionPerformed(ActionEvent e) {
MainFrame.queryDataSet1.saveChanges();
JOptionPane.showMessageDialog(null,"你的修改已经写入到数据库中"
,"修改确认",JOptionPane.INFORMATION_MESSAGE);
}
public void jButton6_actionPerformed(ActionEvent e) {
this.setVisible(false);
}
}
class CheckDialog_jButton6_actionAdapter implements ActionListener {
private CheckDialog adaptee;
CheckDialog_jButton6_actionAdapter(CheckDialog adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton6_actionPerformed(e);
}
}
class CheckDialog_jButton5_actionAdapter implements ActionListener {
private CheckDialog adaptee;
CheckDialog_jButton5_actionAdapter(CheckDialog adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton5_actionPerformed(e);
}
}
class CheckDialog_jButton4_actionAdapter implements ActionListener {
private CheckDialog adaptee;
CheckDialog_jButton4_actionAdapter(CheckDialog adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton4_actionPerformed(e);
}
}
class CheckDialog_jButton3_actionAdapter implements ActionListener {
private CheckDialog adaptee;
CheckDialog_jButton3_actionAdapter(CheckDialog adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton3_actionPerformed(e);
}
}
class CheckDialog_jButton2_actionAdapter implements ActionListener {
private CheckDialog adaptee;
CheckDialog_jButton2_actionAdapter(CheckDialog adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton2_actionPerformed(e);
}
}
class CheckDialog_jButton1_actionAdapter implements ActionListener {
private CheckDialog adaptee;
CheckDialog_jButton1_actionAdapter(CheckDialog adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -