【Java开源代码栏目提醒】:网学会员,鉴于大家对Java开源代码十分关注,论文会员在此为大家搜集整理了“OperatorConfig.java”一文,供大家参考学习!
package com.csbook.restaurant;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
import com.csbook.restaurant.utility.*;
import com.borland.dbswing.*;
import com.borland.dx.sql.dataset.*;
import com.borland.dx.dataset.*;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2003</p>
* <p>Company: </p>
* @author pengtao
* @version 1.0
*/
public class OperatorConfig extends JInternalFrame {
JPanel jPanel1 = new JPanel();
JPanel jPanel3 = new JPanel();
JTextField PICNo = new JTextField();
JPasswordField password = new JPasswordField();
JLabel jLabel4 = new JLabel();
JTextField userID = new JTextField();
JComboBox userType = new JComboBox();
JTextField address = new JTextField();
JLabel jLabel1 = new JLabel();
JLabel jLabel3 = new JLabel();
JLabel jLabel7 = new JLabel();
GridLayout gridLayout1 = new GridLayout(4,4);
JLabel jLabel2 = new JLabel();
JLabel jLabel6 = new JLabel();
JTextField username = new JTextField();
JPanel panel1 = new JPanel();
JLabel jLabel9 = new JLabel();
JTextField tel = new JTextField();
JLabel jLabel5 = new JLabel();
JLabel jLabel8 = new JLabel();
JPanel jPanel2 = new JPanel();
BorderLayout borderLayout1 = new BorderLayout();
Database database1 = new Database();
JPanel jPanel4 = new JPanel();
TableScrollPane tableScrollPane1 = new TableScrollPane();
BorderLayout borderLayout2 = new BorderLayout();
JButton cancel = new JButton();
JPanel jPanel5 = new JPanel();
FlowLayout flowLayout1 = new FlowLayout();
JButton ok = new JButton();
JButton deleteUser = new JButton();
JdbNavToolBar DBNavToolBar = new JdbNavToolBar();
JTextField remark = new JTextField();
QueryDataSet queryDataSet1 = new QueryDataSet();
JdbTable jdbTable1 = new JdbTable();
Column column1 = new Column();
Column column2 = new Column();
Column column3 = new Column();
Column column4 = new Column();
Column column5 = new Column();
Column column6 = new Column();
Column column7 = new Column();
JButton modify = new JButton();
DBDisposeMonitor dBDisposeMonitor1 = new DBDisposeMonitor();
public OperatorConfig(String title,boolean resizable,boolean closable,boolean maximizable,boolean iconifiable) {
super(title,resizable,closable,maximizable,iconifiable);
try {
jbInit();
pack();
}
catch(Exception ex) {
ex.printStackTrace();
}
}
private void jbInit() throws Exception {
PICNo.setText("");
pass
word.setText("");
jLabel4.setRequestFocusEnabled(true);
jLabel4.setText("用户初始密码:");
userID.setText("");
address.setText("");
jLabel1.setText("用户ID:");
jLabel3.setText("联系电话:");
jLabel7.setText("身份证号:");
jLabel2.setText("联系地址:");
jLabel6.setText("用户:");
username.setText("");
panel1.setLayout(gridLayout1);
jLabel9.setText("备注");
tel.setText("");
jLabel5.setText("用户类型:");
jLabel8.setText("请输入新用户的信息");
jPanel3.setLayout(borderLayout1);
database1.setConnection(new com.borland.dx.sql.dataset.ConnectionDescriptor("jdbc:microsoft:
sqlserver://localhost:1433;DatabaseName=Restaurant", "user", "user", false, "com.microsoft.jdbc.sqlserver.SQLServerDriver"));
jPanel4.setLayout(borderLayout2);
cancel.setText("关闭窗口");
cancel.addActionListener(new OperatorConfig_cancel_actionAdapter(this));
jPanel5.setLayout(flowLayout1);
ok.setText("增加用户");
ok.addActionListener(new OperatorConfig_ok_actionAdapter(this));
deleteUser.setActionCommand("jButton1");
deleteUser.setText("删除用户");
deleteUser.addActionListener(new OperatorConfig_deleteUser_actionAdapter(this));
remark.setText("");
queryDataSet1.setMetaDataUpdate(MetaDataUpdate.NONE);
queryDataSet1.setTableName("operator");
queryDataSet1.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(database1, "SELECT operator.id,operator.name,operator.type,operator.tel,operator.addr,operator.PICNo,operator.rem" +
"ark FROM Restaurant.dbo.operator", null, true, Load.ALL));
jdbTable1.setDataSet(queryDataSet1);
column1.setColumnName("id");
column1.setDataType(com.borland.dx.dataset.Variant.STRING);
column1.setPrecision(25);
column1.setRowId(true);
column1.setSchemaName("dbo");
column1.setTableName("operator");
column1.setServerColumnName("id");
column1.setSqlType(1);
column2.setColumnName("name");
column2.setDataType(com.bor