• 大小: 159KB
    文件类型: .7z
    金币: 1
    下载: 0 次
    发布日期: 2021-06-14
  • 语言: Java
  • 标签: JAVA  SQL  

资源简介

仅用了java+sql做了一个简单的库存管理软件,包括入库出库等操作

资源截图

代码片段和文件信息

package inventory;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;


import java.sql.*;

import javax.swing.*;
public class AddCustomer {
JPanel panel;
JLabel CustomerNameCustomerPerSonCustomerTelCustomerPhoneCustomerCodeCustomerPostNoCustomerAddress;//供应商名称,联系人,手机电话,传真,邮编号,地址
JTextField  txtNametxtPerSontxtTeltxtPhonetxtCodetxtPostNotxtosttxtnext;
JComboBox city1city2city3;//省,市,区/县
JButton add;
SqlHelper help;

public  AddCustomer()
{
panel=new JPanel(null);
panel.setBorder(null);
panel.setBackground(new Color(100000));

panel.setBounds(1020980560);
double a=panel.getBounds().width * 0.1;

//标签
CustomerName=new JLabel(“客  户  名  称:“);
CustomerName.setBounds(1002010030);

CustomerPerSon=new JLabel(“客 户 联 系 人:“);
CustomerPerSon.setBounds(3202010030);

CustomerTel=new JLabel(“客  户  电   话:“);
CustomerTel.setBounds(5402010030);

CustomerPhone=new JLabel(“客  户   手   机:“);
CustomerPhone.setBounds(1006010030);

CustomerCode=new JLabel(“客  户  传   真:“);
CustomerCode.setBounds(3206010030);

CustomerPostNo=new JLabel(“客  户  邮   编:“);
CustomerPostNo.setBounds(5406010030);

CustomerAddress=new JLabel(“客  户  地   址:“);
CustomerAddress.setBounds(10010010030);
//文本框
txtName=new JTextField();
txtName.setBounds(2002510025);

txtPerSon=new JTextField();
txtPerSon.setBounds(4202510025);

txtTel=new JTextField();
txtTel.setBounds(6252510025);

txtPhone=new JTextField();
txtPhone.setBounds(2006510025);

txtCode=new JTextField();
txtCode.setBounds(4206510025);

txtPostNo=new JTextField();
txtPostNo.setBounds(6256510025);

txtost=new JTextField(“请输入街道地址“);
txtost.setBounds(545 100 200 25);
txtnext=new JTextField();
txtnext.setBounds(545 100 200 25);

city1=new JComboBox();
    city1=new JComboBox();
    city1.setBounds(21010010025);
    city2=new JComboBox();
    city2.setBounds(32010010025);
    city3=new JComboBox();
    city3.setBounds(42510010025);
    city1.addItem(“湖南省“);
    city1.addItem(“湖北省“);
    
    //事件
    city1.addItemListener(new ItemListener() {

@Override
public void itemStateChanged(ItemEvent e) {
// TODO Auto-generated method stub
String address[]={ “长沙市““株洲市““岳阳市“}; 
String address2[]={“武汉市““黄石市““宜昌市“};
 if(e.getStateChange()!=ItemEvent.SELECTED)
 {
 return;
 }
     city2.removeAllItems();
     if(city1.getSelectedItem()==“湖南省“){
 for (int i = 0; i < address.length; i++) {
city2.addItem(address[i]);
}
 }  
     else {   
        for (int i = 0; i < address2.length; i++) 
        {
 city2.addItem(address2[i]);
   }
      }
}
}); 
      city2.addItemListener(new ItemListener

评论

共有 条评论