超市管理系统设计代码.doc
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_05.gif)
《超市管理系统设计代码.doc》由会员分享,可在线阅读,更多相关《超市管理系统设计代码.doc(98页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。
1、【精品文档】如有侵权,请联系网站删除,仅供学习与交流超市管理系统设计代码.精品文档.import java.awt.*;import java.awt.event.*;import javax.swing.table.*;import javax.swing.event.*;import javax.swing.*;import java.sql.*;import java.util.*;import java.io.*;class Myframe1 extends JFrame /设置主界面JFrame f=new JFrame();JLabel L1,L2;JButton btn1,btn
2、2,btn3,btn4;public Myframe1()f=new JFrame(主界面);L1=new JLabel(超市商品管理系统欢迎您);L1.setFont(new Font(TimesRoman,Font.BOLD,18);L2=new JLabel(您辛苦了);L2.setFont(new Font(TimesRoman,Font.BOLD,18);btn1=new JButton(进货管理系统);btn2=new JButton(售货管理系统);btn3=new JButton(商品信息管理);btn4=new JButton(管理系统帮助);Container contai
3、ner=this.getContentPane();container.setLayout(new GridLayout(9,3,0,50);for(int i=0;i3;i+)container.add(new JLabel();container.add(new JLabel();container.add(L1);container.add(new JLabel();container.add(new JLabel();container.add(btn1);container.add(new JLabel();container.add(new JLabel();container.a
4、dd(btn2);container.add(new JLabel();container.add(new JLabel();container.add(btn3);container.add(new JLabel();container.add(new JLabel();container.add(btn4);container.add(new JLabel();container.add(new JLabel();container.add(L2);container.add(new JLabel(); container.setBackground(Color.cyan); f.add(
5、container);f.setLocation(60,60);f.setSize(750,650);f.setVisible(true);Montior bn=new Montior();btn1.addActionListener(bn);btn2.addActionListener(bn);btn3.addActionListener(bn);btn4.addActionListener(bn); class Montior implements ActionListener public void actionPerformed(ActionEvent e1) if(e1.getSou
6、rce()=btn1) new Myframe2(); if(e1.getSource()=btn2) new Myframe3(); if(e1.getSource()=btn3) new Myframe4(); if(e1.getSource()=btn4) new bangzhu(); class bangzhu extends JFrameJTextPane ta=new JTextPane();JScrollPane sp=new JScrollPane(ta);public bangzhu() super(管理系统帮助); ta.setFont(new Font(TimesRoam
7、an,Font.BOLD+Font.PLAIN,20); ta.setText( 1.初次进入登录系统,系统中没有售货员信息,可以进入系统但是为了以后能够使用方便n+ 还是增加售货员信息,以便下次登录。+ 2.通过编号和密码验证后,进入系统主界面,但是为了能方便的进行操作,要在添加商品信息+ 3.添加了商品信息和售货员信息,即可根据信息进行填写别的表操作。); ta.setEditable(false); Container container=this.getContentPane(); container.setLayout(new BorderLayout(); container.ad
8、d(new JLabel(),BorderLayout.NORTH); container.add(new JLabel(),BorderLayout.WEST); container.add(new JLabel(),BorderLayout.EAST); container.add(new JLabel(),BorderLayout.SOUTH); container.add(sp,BorderLayout.CENTER); this.setSize(400,330); this.setVisible(true);class Myframe2 extends JFrame /设置进货系统的
9、界面Pstock stock=new Pstock();Ptrademan trademan=new Ptrademan();JTabbedPane pane;Myframe2()super(进货管理系统);pane=new JTabbedPane(JTabbedPane.TOP);pane.add(进货单信息,stock);pane.add(进货商信息,trademan);this.add(pane);this.setSize(700,550);this.setLocation(100,100);this.setVisible(true);class Pstock extends JPane
10、l implements ActionListener /添加进货单管理的组件private database db=new database();ResultSet rs;Panel p;Panel p1;JTextArea t;JButton btn1,btn2,btn3,btn4,btn5,btn6;JLabel L1,L2;/表格设置 JTable table; JScrollPane scrollpane; Vector vector; AbstractTableModel tm; String title=条形码,供应商名,进货价,进货日期,进货量;Pstock() create(
11、); p=new Panel(); p1=new Panel(); btn1=new JButton(填写新的进货单); btn2=new JButton(解除购买某商品); btn3=new JButton(修改进货单信息); btn4=new JButton(查询进货单信息); btn5=new JButton(显示进货单所有信息); btn6=new JButton(进货商品的总金额); L1=new JLabel(进货单的信息显示栏,JLabel.CENTER); L1.setFont(new Font(TimesRoman,Font.BOLD,16); L2=new JLabel(进
12、货单信息管理,JLabel.CENTER); L2.setFont(new Font(TimesRoman,Font.BOLD,16); p.setLayout(new GridLayout(9,1,20,20); p.add(L2); p.add(btn1); p.add(btn2); p.add(btn3); p.add(btn4); p.add(btn6); p.add(btn5); p.add(new JLabel(); p.add(new JLabel(); p1.setLayout(new BorderLayout(); p1.add(L1,BorderLayout.NORTH);
13、 p1.add(scrollpane,BorderLayout.CENTER); this.setLayout(new BorderLayout(); this.add(p1,BorderLayout.CENTER); this.add(p,BorderLayout.EAST); btn1.addActionListener(this); btn2.addActionListener(this); btn3.addActionListener(this); btn4.addActionListener(this); btn5.addActionListener(this); btn6.addA
14、ctionListener(this);public void actionPerformed(ActionEvent e2)if(e2.getSource()=btn1)new tianxie();if(e2.getSource()=btn2)new shanchu();if(e2.getSource()=btn3)new xiugai();if(e2.getSource()=btn4)new chaxun();if(e2.getSource()=btn5) /数据库区显示进货单所有信息int flag=0;tryrs=db.select(select * from stocklist);
15、vector.removeAllElements(); while(rs.next() flag=1; Vector rec_vector=new Vector(); rec_vector.addElement(rs.getString(1); rec_vector.addElement(rs.getString(2); rec_vector.addElement(rs.getString(3); rec_vector.addElement(rs.getString(4); rec_vector.addElement(rs.getString(5); vector.addElement(rec
16、_vector); tm.fireTableStructureChanged(); if(flag=0) JOptionPane.showMessageDialog(null,还没有进货单信息); catch(SQLException ee)ee.printStackTrace();if(e2.getSource()=btn6)new jine(); void create() vector = new Vector(); tm = new AbstractTableModel() public int getColumnCount()return title.length;/取得表格列数pu
17、blic int getRowCount()return vector.size();/取得表格行数public Object getValueAt(int row,int column)if(!vector.isEmpty()/取得单元格中的属性值return (Vector)vector.elementAt(row).elementAt(column);elsereturn null;public String getColumnName(int column)return titlecolumn;/设置表格列名public void setValueAt(Object value,int
18、 row,int column)/数据模型不可编辑,该方法设置为空public Class getColumnClass(int c)return getValueAt(0,c).getClass();/取得列所属对象类public boolean isCellEditable(int row,int column)return false;/设置单元格不可编辑,为缺省实现 ; table=new JTable(tm); table.setToolTipText(显示内容); table.setAutoResizeMode(table.AUTO_RESIZE_OFF); table.setCe
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 超市 管理 系统 设计 代码
![提示](https://www.deliwenku.com/images/bang_tan.gif)
限制150内