资源简介
用JAVA写的报刊订阅系统,系统功能包括(1)订户管理(2)目录管理(3)订单管理(4)统计查询(5)帐号管理
代码片段和文件信息
//增加管理员模块
import java.awt.BorderLayout;
import javax.swing.JPanel;
import javax.swing.Jframe;
//import java.awt.Dimension;
import javax.swing.JLabel;
import java.awt.Rectangle;
import java.sql.ResultSet;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import javax.swing.JButton;
import javax.swing.SwingConstants;
import java.awt.Dimension;
public class addadmin extends Jframe {
private static final long serialVersionUID = 1L;
private JPanel jContentPane = null;
private JLabel jLabel = null;
private JLabel jLabel1 = null;
private JLabel jLabel2 = null;
private JTextField jTextField = null;
private JPasswordField jPasswordField = null;
private JPasswordField jPasswordField1 = null;
private JButton jButton = null;
private JButton jButton1 = null;
/**
* This is the default constructor
*/
public addadmin() {
super();
initialize();
setVisible(true);
setLocation(300200);
setResizable(false);
}
/**
* This method initializes this
*
* @return void
*/
private void initialize() {
this.setSize(270 201);
this.setContentPane(getJContentPane());
this.settitle(“创建管理帐号“);
}
/**
* This method initializes jContentPane
*
* @return javax.swing.JPanel
*/
private JPanel getJContentPane() {
if (jContentPane == null) {
jLabel2 = new JLabel();
jLabel2.setBounds(new Rectangle(16 90 93 28));
jLabel2.setHorizontalAlignment(SwingConstants.CENTER);
jLabel2.setText(“确认密码“);
jLabel1 = new JLabel();
jLabel1.setBounds(new Rectangle(16 52 93 28));
jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
jLabel1.setText(“管理密码“);
jLabel = new JLabel();
jLabel.setBounds(new Rectangle(16 13 93 28));
jLabel.setHorizontalAlignment(SwingConstants.CENTER);
jLabel.setText(“新管理帐号“);
jContentPane = new JPanel();
jContentPane.setLayout(null);
jContentPane.add(jLabel null);
jContentPane.add(jLabel1 null);
jContentPane.add(jLabel2 null);
jContentPane.add(getJTextField() null);
jContentPane.add(getJPasswordField() null);
jContentPane.add(getJPasswordField1() null);
jContentPane.add(getJButton() null);
jContentPane.add(getJButton1() null);
}
return jContentPane;
}
/**
* This method initializes jTextField
*
* @return javax.swing.JTextField
*/
private JTextField getJTextField() {
if (jTextField == null) {
jTextField = new JTextField();
jTextField.setBounds(new Rectangle(124 13 119 28));
jTextField.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent e) {
try{
Database DB=new Database();
DB.OpenConn();
String sql=“select * from Login where UName=‘“+jTextField.getText()+“‘“;//执行的sql语句在数据库里查找我们输的用户名
ResultSet rs=DB.executeQuery(sql);
if(rs.next()){
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6638 2010-01-03 18:54 addadmin.java
文件 606 2010-01-03 23:59 Connectdataba
文件 34901 2009-02-19 13:06 DDxinxi.java
文件 4315 2009-02-19 13:06 deleteadmin.java
文件 22863 2010-01-04 14:28 DHTable.java
文件 5244 2010-01-04 00:21 LG.java
文件 7098 2010-01-04 17:00 myfr
文件 3915 2009-02-19 13:09 orderdetail.java
文件 22790 2010-01-04 14:01 SimpleTable.java
文件 402432 2010-01-05 11:18 数据库课程设计.doc
----------- --------- ---------- ----- ----
510802 10
- 上一篇:Makefile分析
- 下一篇:Android6.01隐藏emoji表情
评论
共有 条评论