📄 dbcddialog.java
字号:
package client.dbdialog;
import java.awt.BorderLayout;
import java.awt.Frame;
import javax.swing.JDialog;
import javax.swing.*;
import java.awt.*;
import javax.swing.JLabel;
import client.dbdialog.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import server.action.BusinessAction;
import server.dao.RunSQL;
import client.dbdialog.dialogtemp;
import java.util.Vector;
public class dbcdDialog extends JDialog {
public dbcdDialog() {
try {
jbInit();
} catch (Exception ex) {
ex.printStackTrace();
}
}
private void jbInit() throws Exception {
this.setModal(true);
this.getContentPane().setLayout(null);
this.setSize(330,300);
jLabel1.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
jLabel1.setText("载体类型:");
jLabel1.setBounds(new Rectangle(22, 125, 69, 27));
txfcdid.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
txfcdid.setToolTipText("");
txfcdid.setEditable(false);
txfcdid.setBounds(new Rectangle(94, 18, 57, 22));
jLabel2.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
jLabel2.setToolTipText("");
jLabel2.setText("碟片编号:");
jLabel2.setBounds(new Rectangle(22, 17, 63, 25));
jLabel3.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
jLabel3.setText("电影种类:");
jLabel3.setBounds(new Rectangle(22, 160, 69, 27));
jLabel4.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
jLabel4.setToolTipText("");
jLabel4.setText("备 注:");
jLabel4.setBounds(new Rectangle(22, 232, 69, 27));
cobcdtype.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
cobcdtype.setBounds(new Rectangle(94, 127, 173, 23));
txfcdactor.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
txfcdactor.setBounds(new Rectangle(94, 198, 173, 23));
jLabel5.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
jLabel5.setText("是否在库:");
jLabel5.setBounds(new Rectangle(22, 51, 71, 29));
txfcdname.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
txfcdname.setBounds(new Rectangle(94, 91, 173, 23));
jLabel6.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
jLabel6.setText("电影名称:");
jLabel6.setBounds(new Rectangle(22, 89, 69, 27));
cobcdmtype.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
cobcdmtype.setBounds(new Rectangle(94, 162, 173, 23));
txacdnote.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
txacdnote.setBorder(BorderFactory.createEtchedBorder());
txacdnote.setText("");
txacdnote.setBounds(new Rectangle(94, 232, 173, 95));
jLabel7.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
jLabel7.setText("主 演:");
jLabel7.setBounds(new Rectangle(22, 196, 69, 27));
btncancel.setBounds(new Rectangle(164, 284, 85, 29));
btncancel.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
btncancel.setText("取 消");
btncancel.addActionListener(new dbcdDialog_jButton1_actionAdapter(this));
btnok.setBounds(new Rectangle(56, 284, 85, 29));
btnok.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
btnok.setToolTipText("");
btnok.setText("确 定");
btnok.addActionListener(new dbcdDialog_jButton2_actionAdapter(this));
chbcdexist.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
chbcdexist.setToolTipText("");
chbcdexist.setText(" 碟 片 在 库");
chbcdexist.setBounds(new Rectangle(94, 46, 130, 39));
cobcdtype.addItem("VCD");
cobcdtype.addItem("DVD");
cobcdmtype.addItem("动作");
cobcdmtype.addItem("喜剧");
cobcdmtype.addItem("灾难");
cobcdmtype.addItem("战争");
cobcdmtype.addItem("警匪");
cobcdmtype.addItem("恐怖");
cobcdmtype.addItem("科幻");
cobcdmtype.addItem("动漫");
cobcdmtype.addItem("灾难");
cobcdmtype.addItem("文艺");
cobcdmtype.addItem("爱情");
jPanel2.setLayout(null);
jPanel2.setBorder(BorderFactory.createEtchedBorder());
jPanel2.setVerifyInputWhenFocusTarget(true);
jPanel2.setBounds(new Rectangle(14, 13, 294, 248));
jLabel8.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
jLabel8.setToolTipText("");
jLabel8.setText("可借碟数:");
jLabel8.setBounds(new Rectangle(22, 194, 69, 27));
txfcardid.setToolTipText("");
txfcardid.setEditable(false);
txfcardid.setText("");
txfcardid.setBounds(new Rectangle(107, 18, 145, 22));
jLabel11.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
jLabel11.setText(" 客户名:");
jLabel11.setBounds(new Rectangle(22, 106, 69, 27));
txfcardbalance.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
txfcardbalance.setText("");
txfcardbalance.setBounds(new Rectangle(107, 152, 145, 22));
jLabel12.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
jLabel12.setToolTipText("");
jLabel12.setText(" 卡编号:");
jLabel12.setBounds(new Rectangle(22, 17, 63, 25));
txfcardpwd.setText("");
txfcardpwd.setBounds(new Rectangle(107, 63, 145, 22));
jLabel13.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
jLabel13.setText(" 卡密码:");
jLabel13.setBounds(new Rectangle(22, 61, 69, 27));
jPanel1.setVerifyInputWhenFocusTarget(true);
jLabel9.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
jLabel9.setText(" 余 额:");
jLabel9.setBounds(new Rectangle(22, 152, 66, 24));
txfcardusername.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
txfcardusername.setBounds(new Rectangle(107, 107, 145, 22));
txfcardrestnum.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
txfcardrestnum.setBounds(new Rectangle(107, 196, 145, 22));
jPanel3.setLayout(null);
txfrecid.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
txfrecid.setEditable(false);
txfrecid.setText("");
txfrecid.setBounds(new Rectangle(109, 21, 157, 25));
txfreccardid.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
txfreccardid.setText("");
txfreccardid.setBounds(new Rectangle(109, 79, 157, 25));
txfreccdid.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
txfreccdid.setText("");
txfreccdid.setBounds(new Rectangle(109, 137, 157, 25));
txfrecstarttime.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
txfrecstarttime.setText("");
txfrecstarttime.setBounds(new Rectangle(109, 195, 157, 25));
txfrecendtime.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
txfrecendtime.setText("");
txfrecendtime.setBounds(new Rectangle(109, 253, 157, 25));
jLabel10.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
jLabel10.setText("记录号:");
jLabel10.setBounds(new Rectangle(23, 20, 101, 27));
jLabel14.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
jLabel14.setText("记录卡号:");
jLabel14.setBounds(new Rectangle(23, 73, 101, 27));
jLabel15.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
jLabel15.setText("记录光碟号:");
jLabel15.setBounds(new Rectangle(23, 133, 101, 27));
jLabel16.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
jLabel16.setText("借出时间:");
jLabel16.setBounds(new Rectangle(23, 198, 101, 27));
jLabel17.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
jLabel17.setText("归还时间:");
jLabel17.setBounds(new Rectangle(23, 252, 101, 27));
jPanel3.setBorder(BorderFactory.createEtchedBorder());
jPanel1.add(txfcdid);
jPanel1.add(txacdnote);
jPanel1.add(cobcdtype);
jPanel1.add(cobcdmtype);
jPanel1.add(txfcdactor);
jPanel1.add(txfcdname);
jPanel1.add(jLabel2);
jPanel1.add(jLabel5);
jPanel1.add(jLabel6);
jPanel1.add(jLabel1);
jPanel1.add(jLabel3);
jPanel1.add(jLabel7);
jPanel1.add(jLabel4);
jPanel1.add(chbcdexist);
jPanel1.setBorder(BorderFactory.createEtchedBorder());
jPanel1.setBounds(new Rectangle(397, 368, 210, 414));
jPanel1.setLayout(null);
jPanel2.add(jLabel12);
jPanel2.add(jLabel13);
jPanel2.add(txfcardpwd);
jPanel2.add(jLabel11);
jPanel2.add(txfcardusername);
jPanel2.add(jLabel9);
jPanel2.add(txfcardbalance);
jPanel2.add(jLabel8);
jPanel2.add(txfcardrestnum);
jPanel2.add(txfcardid);
this.getContentPane().add(btnok, null);
this.getContentPane().add(btncancel, null);
jPanel3.add(jLabel10);
jPanel3.add(txfrecid);
jPanel3.add(jLabel14);
jPanel3.add(txfreccardid);
jPanel3.add(jLabel15);
jPanel3.add(txfreccdid);
jPanel3.add(txfrecstarttime);
jPanel3.add(jLabel16);
jPanel3.add(jLabel17);
jPanel3.add(txfrecendtime);
//增加cd数据时的初始化
if (dialogtemp.getflag()==1)
{
chbcdexist.setSelected(true);
txfcdactor.setText("无");
txacdnote.setText("无");
int cdid=BusinessAction.getmaxcdid()+1;
txfcdid.setText(cdid+"");
//初始化panel和按钮
btnok.setBounds(new Rectangle(56, 368, 85, 29));
btncancel.setBounds(new Rectangle(186, 369, 85, 29));
jPanel1.setBounds(new Rectangle(14, 13, 294, 342));
this.getContentPane().add(jPanel1, null);
this.setTitle("添加光碟数据");
this.setSize(330,450);
}
//编辑cd数据时的初始化
if (dialogtemp.getflag()==2)
{
//得到临时Vector的值并显示在Dialog中
Vector show=dialogtemp.getmdfvector();
txfcdid.setText(show.elementAt(0).toString());
if (show.elementAt(1).toString().equals("false"))
{chbcdexist.setSelected(false);}
else
{chbcdexist.setSelected(true);}
txfcdname.setText(show.elementAt(2).toString());
cobcdtype.setSelectedItem(show.elementAt(3).toString());
cobcdmtype.setSelectedItem(show.elementAt(4).toString());
txfcdactor.setText(show.elementAt(5).toString());
txacdnote.setText(show.elementAt(6).toString());
//初始化panel和按钮
btnok.setBounds(new Rectangle(56, 368, 85, 29));
btncancel.setBounds(new Rectangle(186, 369, 85, 29));
jPanel1.setBounds(new Rectangle(14, 13, 294, 342));
this.getContentPane().add(jPanel1, null);
this.setTitle("修改光碟数据");
this.setSize(330,450);
}
//增加card数据时的初始化
if (dialogtemp.getflag()==3)
{
int newcardid=BusinessAction.getmaxcardid()+1;
txfcardid.setText(newcardid+"");
//初始化panel和按钮
btnok.setBounds(new Rectangle(56, 284, 85, 29));
btncancel.setBounds(new Rectangle(186, 284, 85, 29));
jPanel1.setBounds(new Rectangle(14, 13, 294, 342));
this.getContentPane().add(jPanel2);
this.setTitle("添加卡数据");
this.setSize(330,370);
}
//编辑card数据时的初始化
if (dialogtemp.getflag()==4)
{
//得到临时Vector的值并显示在Dialog中
Vector show=dialogtemp.getmdfvector();
txfcardid.setText(show.elementAt(0).toString());
txfcardpwd.setText(show.elementAt(1).toString());
txfcardusername.setText(show.elementAt(2).toString());
txfcardbalance.setText(show.elementAt(3).toString());
txfcardrestnum.setText(show.elementAt(4).toString());
//初始化panel和按钮
btnok.setBounds(new Rectangle(56, 284, 85, 29));
btncancel.setBounds(new Rectangle(186, 284, 85, 29));
jPanel1.setBounds(new Rectangle(14, 13, 294, 342));
this.getContentPane().add(jPanel2);
this.setTitle("修改卡数据");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -