📄 operatorsystemframe.java
字号:
package untitled2;
import javax.swing.*;
import java.awt.*;
import com.borland.jbcl.layout.*;
import com.borland.dbswing.*;
import com.borland.dx.sql.dataset.*;
import java.awt.event.*;
import java.sql.Statement;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.swing.border.*;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2006</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
*/
public class OperatorSystemFrame extends JFrame {
XYLayout xYLayout1 = new XYLayout();
JTabbedPane jTabbedPane1 = new JTabbedPane();
JPanel AddUser = new JPanel();
JPanel jPanel2 = new JPanel();
JTextField User = new JTextField();
XYLayout xYLayout2 = new XYLayout();
JLabel jLabel1 = new JLabel();
JComboBox jComboBox1 = new JComboBox();
JButton jButton1 = new JButton();
Database database1 = new Database();
QueryDataSet queryDataSet1 = new QueryDataSet();
Connection con;
Statement st;
PreparedStatement ps;
ResultSet rs;
String sql;
static boolean flag;
static int statu;
JPanel jPanel1 = new JPanel();
JTextField jtfuser = new JTextField();
JLabel jLabel3 = new JLabel();
JButton jButton2 = new JButton();
JPanel jPanel3 = new JPanel();
JTextField jTextField1 = new JTextField();
XYLayout xYLayout4 = new XYLayout();
JButton jButton4 = new JButton();
JLabel fffff = new JLabel();
TitledBorder titledBorder1;
JTextField jTextField2 = new JTextField();
JTextField jTextField3 = new JTextField();
JTextField jTextField4 = new JTextField();
JButton jButton6 = new JButton();
JButton jButton3 = new JButton();
Border border1;
TitledBorder titledBorder2;
Border border2;
JLabel jLabel4 = new JLabel();
JLabel jLabel5 = new JLabel();
JLabel jLabel6 = new JLabel();
JLabel jLabel7 = new JLabel();
JLabel jLabel8 = new JLabel();
JButton jButton5 = new JButton();
JLabel jLabel2 = new JLabel();
TableScrollPane tableScrollPane1 = new TableScrollPane();
JdbTable jdbTable1 = new JdbTable();
public OperatorSystemFrame() {
try {
jbInit();
jComboBox1.addItem("系统管理员");
jComboBox1.addItem("教务处人员");
jComboBox1.addItem("班主任");
jComboBox1.addItem("老师");
jComboBox1.addItem("学生");
}
catch (Exception ex) {
ex.printStackTrace();
}
}
void jbInit() throws Exception {
titledBorder1 = new TitledBorder(BorderFactory.createEtchedBorder(Color.white,new Color(148, 145, 140)),"修改密码");
border1 = new EtchedBorder(EtchedBorder.RAISED,Color.white,SystemColor.desktop);
titledBorder2 = new TitledBorder(new EtchedBorder(EtchedBorder.RAISED,Color.white,SystemColor.desktop),"修改密码");
border2 = new EtchedBorder(EtchedBorder.RAISED,Color.white,SystemColor.desktop);
this.getContentPane().setLayout(xYLayout1);
AddUser.setBackground(Color.white);
AddUser.setFont(new java.awt.Font("幼圆", 0, 13));
AddUser.setForeground(new Color(0, 13, 165));
AddUser.setLayout(xYLayout2);
jPanel2.setBackground(SystemColor.desktop);
jPanel2.setFont(new java.awt.Font("幼圆", 0, 13));
jPanel2.setAlignmentY( (float) 0.5);
jPanel2.setMinimumSize(new Dimension(10, 10));
jPanel2.setLayout(null);
jTabbedPane1.setBackground(Color.white);
jTabbedPane1.setOpaque(true);
this.getContentPane().setBackground(SystemColor.text);
this.setSize(new Dimension(800, 600));
this.setVisible(true);
User.setBorder(border1);
User.setSelectionStart(11);
User.setText("");
jLabel1.setFont(new java.awt.Font("幼圆", 0, 13));
jLabel1.setForeground(new Color(0, 92, 165));
jLabel1.setRequestFocusEnabled(true);
jLabel1.setText("用户名");
jButton1.setBackground(new Color(131, 177, 197));
jButton1.setFont(new java.awt.Font("幼圆", 0, 13));
jButton1.setBorder(border1);
jButton1.setText("添加 ");
jButton1.addActionListener(new OperatorSystemFrame_jButton1_actionAdapter(this));
database1.setConnection(new com.borland.dx.sql.dataset.ConnectionDescriptor(
"jdbc:odbc:Digital_Campus", "dbw", "123456", false,
"sun.jdbc.odbc.JdbcOdbcDriver"));
queryDataSet1.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(
database1,
"SELECT login.user_name as 姓名,login.password as 密码,login.user_type " +
"as 权限 FROM Digital_Campus.dbo.login", null, true, Load.ALL));
jPanel1.setLayout(null);
jtfuser.setBorder(border1);
jtfuser.setText("");
jtfuser.setBounds(new Rectangle(144, 29, 81, 22));
jLabel3.setBackground(SystemColor.desktop);
jLabel3.setFont(new java.awt.Font("幼圆", 0, 13));
jLabel3.setForeground(new Color(0, 92, 165));
jLabel3.setDoubleBuffered(false);
jLabel3.setPreferredSize(new Dimension(22, 16));
jLabel3.setText("用户名");
jLabel3.setBounds(new Rectangle(82, 26, 47, 28));
jButton2.setBackground(new Color(131, 177, 197));
jButton2.setBounds(new Rectangle(259, 29, 63, 27));
jButton2.setFont(new java.awt.Font("Dialog", 0, 13));
jButton2.setBorder(border2);
jButton2.setText("查询");
// jButton2.addActionListener(new OperatorSystemFrame_jButton2_actionAdapter(this));
jButton2.addActionListener(new OperatorSystemFrame_jButton2_actionAdapter(this));
jPanel3.setLayout(xYLayout4);
jButton4.setBackground(new Color(131, 177, 197));
jButton4.setBounds(new Rectangle(350, 29, 68, 25));
jButton4.setFont(new java.awt.Font("幼圆", 0, 13));
jButton4.setBorder(border1);
jButton4.setText("删除");
jButton4.addActionListener(new OperatorSystemFrame_jButton4_actionAdapter(this));
//jButton5.setBounds(new Rectangle(302, 124, 57, 25));
// jButton5.setSize(new Dimension(57, 25));
// jButton5.setText("确定");
// jButton5.addActionListener(new OperatorSystemFrame_jButton5_actionAdapter(this));
fffff.setFont(new java.awt.Font("幼圆", 0, 13));
fffff.setForeground(new Color(0, 92, 165));
fffff.setText("密码");
jTextField1.setBackground(Color.white);
jTextField1.setEnabled(true);
jTextField1.setBorder(border1);
jTextField1.setDoubleBuffered(false);
jTextField1.setEditable(false);
jTextField1.setText("");
jPanel3.setBackground(Color.white);
jPanel3.setFont(new java.awt.Font("幼圆", 0, 13));
jPanel3.setForeground(new Color(0, 92, 165));
jPanel3.setName("");
jPanel3.setVisible(false);
jPanel3.setBorder(titledBorder2);
jPanel3.setRequestFocusEnabled(true);
jPanel3.setBounds(new Rectangle(51, 93, 418, 125));
jTextField2.setBorder(border1);
jTextField2.setText("");
jTextField2.setBounds(new Rectangle(152, 249, 111, 22));
jTextField2.addActionListener(new OperatorSystemFrame_jTextField2_actionAdapter(this));
jTextField3.setBorder(border1);
jTextField3.setText("");
jTextField3.setBounds(new Rectangle(152, 300, 109, 22));
jTextField4.setBorder(border1);
jTextField4.setText("");
jTextField4.setBounds(new Rectangle(152, 348, 111, 22));
jPanel1.setBackground(Color.white);
jPanel1.setBounds(new Rectangle(-16, 2, 796, 537));
jButton6.setBackground(new Color(131, 177, 197));
jButton6.setFont(new java.awt.Font("幼圆", 0, 13));
jButton6.setBorder(border1);
jButton6.setText("确定");
jButton6.addActionListener(new OperatorSystemFrame_jButton6_actionAdapter(this));
jButton3.setBackground(new Color(131, 177, 197));
jButton3.setFont(new java.awt.Font("幼圆", 0, 13));
jButton3.setBorder(border1);
jButton3.setText("修改");
jButton3.addActionListener(new OperatorSystemFrame_jButton3_actionAdapter(this));
jLabel4.setBounds(new Rectangle(79, 246, 47, 28));
jLabel4.setText("用户名");
jLabel4.setPreferredSize(new Dimension(22, 16));
jLabel4.setDoubleBuffered(false);
jLabel4.setForeground(new Color(0, 92, 165));
jLabel4.setFont(new java.awt.Font("幼圆", 0, 13));
jLabel4.setBackground(SystemColor.desktop);
jLabel5.setBounds(new Rectangle(82, 300, 47, 28));
jLabel5.setText("密码");
jLabel5.setPreferredSize(new Dimension(22, 16));
jLabel5.setDoubleBuffered(false);
jLabel5.setForeground(new Color(0, 92, 165));
jLabel5.setFont(new java.awt.Font("幼圆", 0, 13));
jLabel5.setBackground(SystemColor.desktop);
jLabel6.setBounds(new Rectangle(83, 345, 47, 28));
jLabel6.setText("权限");
jLabel6.setPreferredSize(new Dimension(22, 16));
jLabel6.setDoubleBuffered(false);
jLabel6.setForeground(new Color(0, 92, 165));
jLabel6.setFont(new java.awt.Font("幼圆", 0, 13));
jLabel6.setBackground(SystemColor.desktop);
jLabel7.setIcon(new ImageIcon(new java.net.URL("file:///D:/UI/pp/12345 .jpg")));
jLabel7.setText("");
jLabel7.setBounds(new Rectangle(320, 247, 421, 288));
jComboBox1.setBackground(Color.white);
jComboBox1.setBorder(border1);
jLabel8.setText("密码");
jLabel8.setRequestFocusEnabled(true);
jLabel8.setForeground(new Color(0, 92, 165));
jLabel8.setFont(new java.awt.Font("幼圆", 0, 13));
jButton5.addActionListener(new OperatorSystemFrame_jButton5_actionAdapter(this));
jButton5.setText("退出");
jButton5.addActionListener(new OperatorSystemFrame_jButton5_actionAdapter(this));
jButton5.setBorder(border1);
jButton5.setFont(new java.awt.Font("幼圆", 0, 13));
jButton5.setBackground(new Color(131, 177, 197));
jLabel2.setIcon(new ImageIcon(new java.net.URL("file:///D:/UI/pp/12345 .jpg")));
jLabel2.setText("");
jdbTable1.setDataSet(queryDataSet1);
AddUser.add(User, new XYConstraints(140, 36, 115, -1));
AddUser.add(jComboBox1, new XYConstraints(140, 81, 117, -1));
AddUser.add(jLabel1, new XYConstraints(62, 40, -1, -1));
AddUser.add(jLabel8, new XYConstraints(68, 84, 33, 18));
AddUser.add(jButton1, new XYConstraints(360, 79, 73, 26));
AddUser.add(jButton5, new XYConstraints(495, 79, 73, 26));
AddUser.add(tableScrollPane1, new XYConstraints(57, 173, 269, 326));
AddUser.add(jLabel2, new XYConstraints(359, 248, -1, -1));
tableScrollPane1.getViewport().add(jdbTable1, null);
jTabbedPane1.add(jPanel2, "维护用户");
jPanel2.add(jPanel1, null);
jPanel3.add(jButton3, new XYConstraints(204, 27, 62, 25));
jPanel3.add(jButton6, new XYConstraints(303, 27, 62, 24));
jPanel3.add(fffff, new XYConstraints(33, 27, 44, 25));
jPanel3.add(jTextField1, new XYConstraints(89, 31, 80, -1));
jPanel1.add(jLabel6, null);
jPanel1.add(jTextField2, null);
jPanel1.add(jLabel4, null);
jPanel1.add(jLabel5, null);
jPanel1.add(jTextField3, null);
jPanel1.add(jTextField4, null);
jPanel1.add(jLabel7, null);
jTabbedPane1.add(AddUser, "添加用户");
jPanel1.add(jLabel3, null);
jPanel1.add(jtfuser, null);
jPanel1.add(jButton2, null);
jPanel1.add(jButton4, null);
jPanel1.add(jPanel3, null);
this.getContentPane().add(jTabbedPane1, new XYConstraints(14, 18, 777, 570));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -