ImageVerifierCode 换一换
格式:DOCX , 页数:32 ,大小:21.76KB ,
资源ID:17348882      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/17348882.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(能源管理系统源代码Word格式文档下载.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

能源管理系统源代码Word格式文档下载.docx

1、 private Connection con = null; Statement stmt = null; private ResultSet r = null; private JLabel idlabel = new JLabel(ID ); private JTextField id = new JTextField(10); private JLabel pwdlabel = new JLabel(密码 private JPasswordField pwd = new JPasswordField(10); private JButton commit = new JButton(登

2、陆 private String command = null; public login() setTitle(能源管理系统 setSize(236, 248); addWindowListener(new WindowAdapter() public void windowClosing(WindowEvent e) System.exit(0); ); getContentPane().setLayout(new GridBagLayout(); JPanel jp1 = new JPanel(); GridBagConstraints gbc_jp1 = new GridBagCons

3、traints(); gbc_jp1.anchor = GridBagConstraints.SOUTHEAST; gbc_jp1.insets = new Insets(0, 0, 5, 0); gbc_jp1.gridx = 0; gbc_jp1.gridy = 0; getContentPane().add(jp1, gbc_jp1); jp1.add(idlabel); jp1.add(id); JPanel jp2 = new JPanel(); jp2.add(pwdlabel); jp2.add(pwd); JPanel jp9 = new JPanel(); jp9.setLa

4、yout(new GridLayout(3, 1); jp9.add(jp2); JPanel jp10 = new JPanel(); jp10.setLayout(new BorderLayout(); jp10.add(West, jp9); jp9.add(commit); commit.addActionListener(this); GridBagConstraints gbc_jp10 = new GridBagConstraints(); gbc_jp10.insets = new Insets(0, 0, 5, 0); gbc_jp10.gridx = 0; gbc_jp10

5、.gridy = 1; getContentPane().add(jp10, gbc_jp10); try String url = jdbc:sqlserver:/localhost:1433;databaseName=energy_management;integratedSecurity=true; Class.forName(com.microsoft.sqlserver.jdbc.SQLServerDriver System.out.println(驱动程序已装载即将连接数据库 con = DriverManager.getConnection(url, sa, 123456load

6、 ok stmt = con.createStatement(); catch (Exception ex) System.out.println(ex.getMessage(); public void actionPerformed(ActionEvent evt) String uid = id.getText().trim(); String upwd = pwd.getText(); String c1 = like + uid + String c2 = + upwd + command = select * + from manager_info where id + c1 +

7、and password + c2; r = stmt.executeQuery(command); if (uid.length() != 0 | upwd.length() != 0) if (r.next() JOptionPane.showMessageDialog(commit, 登陆成功提示, JOptionPane.INFORMATION_MESSAGE); mainFrame mf = new mainFrame(); mf.showf(); setVisible(false); else ID或者密码错误警告 JOptionPane.ERROR_MESSAGE); else

8、JOptionPane.showMessageDialog(commit, ID或者密码不能为空 JOptionPane.ERROR_MESSAGE); public static void main(String args) JFrame myframe = new login(); myframe.setVisible(true);操作界面源代码package mainmenu;import java.awt.Container;import java.awt.event.InputEvent;import java.awt.event.KeyEvent;import javax.swin

9、g.JMenu;import javax.swing.JMenuBar;import javax.swing.JMenuItem;import javax.swing.JToolBar;import javax.swing.KeyStroke;import consume_query.Queryconsume;import price_management.queryprice;import price_management.updateprice;import user_info_insert.insert_user_information;import user_info_insert.u

10、ser_info_delete;import user_record_insert.insert_user_record;import loginframe.login;public class mainFrame extends JFrame public mainFrame() public static final int h = 200; public static final int w = 370; JFrame mainframe; public void showf() mainframe = new JFrame(); mainframe.setTitle(管理员操作 mai

11、nframe.setSize(500, 130); mainframe.setResizable(true); meaushow(); showtool(); mainframe.show(); public void meaushow() JMenuBar meaubar = new JMenuBar(); JMenu file = new JMenu(文件 JMenuItem logout = new JMenuItem(注销, L JMenuItem exit = new JMenuItem(退出E JMenu help = new JMenu(帮助 JMenuItem about =

12、new JMenuItem(关于A logout.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_L, InputEvent.CTRL_MASK); exit.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, about.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, logout.addActionListener(new ActionListener() Override public void actionPerformed

13、(ActionEvent e) mainframe.setVisible(false); login myframe = new login(); myframe.setVisible(true); / TODO Auto-generated method stub exit.addActionListener(new ActionListener() / TODO Auto-generated method stub about.addActionListener(new ActionListener() JOptionPane.showMessageDialog(mainframe, 这是

14、一个能源管理收费系统, JOptionPane.INFORMATION_MESSAGE); ; meaubar.add(file); meaubar.add(help); file.add(logout); file.add(exit); help.add(about); mainframe.setJMenuBar(meaubar); public void showtool() JToolBar toolbar = new JToolBar(); JButton l1 = new JButton(用户信息录入 JButton l2 = new JButton(价格查询 JButton l3

15、= new JButton(价格更改 JButton l4 = new JButton(用户记录信息录入 JButton l5 = new JButton(收费查询 JButton l6 = new JButton(删除用户 toolbar.add(l1); toolbar.add(l2); toolbar.add(l3); toolbar.add(l4); toolbar.add(l5); toolbar.add(l6); Container contentpane = mainframe.getContentPane(); contentpane.add(toolbar); l1.addA

16、ctionListener(new ActionListener() JFrame myframe = new insert_user_information(); / TODO Auto-generated method stub l2.addActionListener(new ActionListener() JFrame myframe = new queryprice(); l3.addActionListener(new ActionListener() JFrame myframe = new updateprice(); l4.addActionListener(new Act

17、ionListener() JFrame myframe = new insert_user_record(); l5.addActionListener(new ActionListener() JFrame myframe = new Queryconsume(); l6.addActionListener(new ActionListener() JFrame mFrame=new user_info_delete(); mFrame.setVisible(true); / TODO Auto-generated method stub mainFrame mf = new mainFr

18、ame(); mf.showf();各个操作的源代码:(1)录入用户基本信息:package user_info_insert;import javax.swing.SwingConstants;public class insert_user_information extends JFrame implements ActionListener private JLabel Title = new JLabel(请输入新用户的信息, SwingConstants.CENTER);用户ID private JTextField id = new JTextField(15); private

19、 JLabel namelabel = new JLabel(姓名 private JTextField name = new JTextField(15); private JLabel sexlabel = new JLabel(性别 private JTextField sex = new JTextField(15); private JLabel addresslabel = new JLabel(家庭地址 private JTextField address = new JTextField(15); private JLabel telephonelabel = new JLab

20、el(电话 private JTextField telephone = new JTextField(15); private JLabel workplacelabel = new JLabel(工作地点 private JTextField workplace = new JTextField(15); private JLabel departmentlabel = new JLabel(部门 private JTextField department = new JTextField(15); private JLabel remarklabel = new JLabel(备注 private JTextField remark = new JTextField(15);提交 public insert_user_information() 用户

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1