package internalFrame.shangPinXiaoShou;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.Vector;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.event.InternalFrameAdapter;
import javax.swing.event.InternalFrameEvent;
import javax.swing.table.DefaultTableModel;
import keyListener.InputKeyListener;
import model.TabKucun;
import model.TabSellDetail;
import model.TabSellMain;
import model.TabSpinfo;
import model.Userlist;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import dao.UserDAO;
public class ShangPinXiaoShou extends JInternalFrame implements ApplicationContextAware {
/**
*
*/
private static final long serialVersionUID = -1391613348438786914L;
private JTextField shishou;
private JTextField shuliang;
private JTextField danjia;
private JTextField jsr;
private JComboBox guige;
private JComboBox spName;
private JTextField weishou;
private JTextField yingshou;
private JComboBox jsMode;
private JComboBox clientName;
private JTable table;
private DefaultTableModel dtm;
private JLabel sellDate;
private JLabel czy;
private Userlist user;
private UserDAO dao;
private ApplicationContext appContext;
private Date cellDateTime;
private TabSellMain sellMain = new TabSellMain();
private Set tabSellDetails = sellMain.getTabSellDetails();
@Override
public void setApplicationContext(ApplicationContext app) throws BeansException {
appContext = app;
dao = (UserDAO) appContext.getBean("DAOProxyTransactionFactory");
user = (Userlist) appContext.getBean("loginUser");
}
public ShangPinXiaoShou() {
addInternalFrameListener(new InternalFrameAdapter() {
@Override
public void internalFrameActivated(final InternalFrameEvent e) {
czy.setText(user.getId().getName());
new Thread(new Runnable() {
@Override
public void run() {
while (true) {
cellDateTime = new Date();
sellDate.setText(cellDateTime.toLocaleString());
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}).start();
List list = dao.queryObject("select khname from TabKhinfo");
Iterator iterator = list.iterator();
DefaultComboBoxModel dcbm = (DefaultComboBoxModel) clientName.getModel();
dcbm.removeAllElements();
while (iterator.hasNext()) {
dcbm.addElement(iterator.next().toString().trim());
}
list = dao.queryObject("select spname from TabKucun");
iterator = list.iterator();
dcbm = (DefaultComboBoxModel) spName.getModel();
dcbm.removeAllElements();
while (iterator.hasNext()) {
dcbm.addElement(iterator.next().toString().trim());
}
}
});
setMaximizable(true);
setIconifiable(true);
setClosable(true);
getContentPane().setLayout(new GridBagLayout());
setTitle("商品销售");
setBounds(100, 100, 647, 375);
final JLabel label = new JLabel();
label.setFont(new Font("", Font.PLAIN, 14));
label.setText("操 作 员:");
final GridBagConstraints gridBagConstraints = new GridBagConstraints();
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
gridBagConstraints.gridy = 0;
gridBagConstraints.gridx = 0;
getContentPane().add(label, gridBagConstraints);
czy = new JLabel();
final GridBagConstraints gridBagConstraints_1 = new GridBagConstraints();
gridBagConstraints_1.gridwidth = 4;
gridBagConstraints_1.fill = GridBagConstraints.HORIZONTAL;
gridBagConstraints_1.ipadx = 45;
gridBagConstraints_1.gridy = 0;
gridBagConstraints_1.gridx = 2;
getContentPane().add(czy, gridBagConstraints_1);
czy.setFont(new Font("", Font.PLAIN, 14));
final JLabel label_1 = new JLabel();
label_1.setFont(new Font("", Font.PLAIN, 14));
label_1.setText("销售时间:");
final GridBagConstraints gridBagConstraints_2 = new GridBagConstraints();
gridBagConstraints_2.insets = new Insets(0, 0, 0, 0);
gridBagConstraints_2.weightx = 1.0;
gridBagConstraints_2.ipadx = 30;
gridBagConstraints_2.gridy = 0;
gridBagConstraints_2.gridx = 6;
getContentPane().add(label_1, gridBagConstraints_2);
sellDate = new JLabel();
sellDate.setFont(new Font("", Font.PLAIN, 14));
final GridBagConstraints gridBagConstraints_3 = new GridBagConstraints();
gridBagConstraints_3.weightx = 1.0;
gridBagConstraints_3.gridwidth = 6;
gridBagConstraints_3.fill = GridBagConstraints.HORIZONTAL;
gridBagConstraints_3.insets = new Insets(0, 0, 0, 10);
gridBagConstraints_3.anchor = GridBagConstraints.WEST;
gridBagConstraints_3.ipadx = 95;
gridBagConstraints_3.gridy = 0;
gridBagConstraints_3.gridx = 10;
getContentPane().add(sellDate, gridBagConstraints_3);
final JScrollPane scrollPane = new JScrollPane();
scrollPane.setFont(new Font("", Font.PLAIN, 14));
final GridBagConstraints gridBagConstraints_4 = new GridBagConstraints();
gridBagConstraints_4.insets = new Insets(0, 10, 5, 10);
gridBagConstraints_4.weighty = 1.0;
gridBagConstraints_4.fill = GridBagConstraints.BOTH;
gridBagConstraints_4.gridwidth = 16;
gridBagConstraints_4.gridy = 1;
gridBagConstraints_4.gridx = 0;
getContentPane().add(scrollPane, gridBagConstraints_4);
table = new JTable();
table.setFont(new Font("", Font.PLAIN, 14));
table.setShowGrid(true);
table.setEnabled(false);
table.putClientProperty("Quaqua.Table.style", "striped");
dtm = (DefaultTableModel) table.getModel();
String[] tableHeads = new String[] { "商品名称", "规格", "单价", "数量" };
dtm.setColumnIdentifiers(tableHeads);
scrollPane.setViewportView(table);
final JLabel label_2 = new JLabel();
label_2.setFont(new Font("", Font.PLAIN, 14));
label_2.setText("客户全称:");
final GridBagConstraints gridBagConstraints_6 = new GridBagConstraints();
gridBagConstraints_6.insets = new Insets(0, 5, 0, 0);
gridBagConstraints_6.gridy = 3;
gridBagConstraints_6.gridx = 0;
getContentPane().add(label_2, gridBagConstraints_6);
clientName = new JComboBox();
clientName.setMaximumRowCount(9);
clientName.setFont(new Font("", Font.PLAIN, 14))
zhuxun198
- 粉丝: 5
- 资源: 243
最新资源
- C# OPC UA DA通信源代码示例:工业上位机必备,简单直接使用,高效稳定传输数据 ,C# opc ua da通信源代码示例,应用简单直接可使用 工业上位机必备代码 ,核心关键词:C#;OPC
- Matlab实现极端随机森林(ERF)数据分类预测:基于类别增量的高效分类算法,基于类别增量的极端随机森林(ERF)数据分类预测 matlab代码 ,基于类别增量的极端随机森林(ERF)数据分类预测
- 堆垛机PLC程序介绍:基于PLC 1500SP F-1PN,配有清晰SCL注释和安全保密设计,堆垛机程序,硬件配置:PLC:1500SP F-1PN HMI:KTP700 Basic PN X轴:S1
- Matlab代码实现基于拉格朗日算法的电力系统多不良参数辨识与IEEE 14节点系统仿真验证,Matlab代码-基于拉格朗日电力系统参数辨识 对电力系统中存在多个不良参数进行辨识,以IEEE14节点系
- 自建dq坐标系下的永磁同步电机PMSM模型:从基础入门到实践应用附赠参考资料,自建dq坐标系永磁同步电机pmsm模型 不是库里的模块,适用于新手入门学习 赠参考资料 ,核心关键词: 自建; DQ坐
- 基于NPC整流器的三电平中点钳位PWM整流器模型研究,NPC整流器,三电平,中点钳位 PWM整流器三电平模型 ,核心关键词:NPC整流器; 三电平; 中点钳位; PWM整流器三电平模型;,三电平
- 料箱输送线的自动化程序:含目的地跟踪、设备布局和电气图纸,基于STL与PLC控制,配备英特诺电机等硬件 ,料箱输送线程序,带目的地跟踪,提供设备布局图和电气图纸以及博途程序 程序语言较多使用了STL
- 步进伺服控制程序:三菱PLC与威纶触摸屏编写实践,成熟可靠适用于新手学习,高借鉴价值带注释 ,步进伺服控制程序 用三菱plc和威纶触摸屏编写 新手学习最佳选择 此程序已经实际设备上批量应用,程
- 伺服驱动器和变频器源码原理图全集合:囊括市场热门产品GD系列变频器与EP系列伺服驱动器方案学习库,变频器源码、图纸、生产方案 伺服驱动器和变频器源码、图纸、生产方案 此文件包涵盖 1、迈信EP100
- 基于多约束MPC的ACC模型预测自适应巡航设计:涵盖动力、经济性及安全因素的综合仿真研究,多约束的MPC ACC模型预测ACC设计 自适应巡航 考虑经济性,安全性,动力行等多因素的 不是单纯的速度
- 土壤源热泵模型在comsol环境下的应用与实践,comsol的土壤源热泵模型 ,核心关键词:Comsol; 土壤源; 热泵模型; 模拟分析; 地下热能利用; 能源效率; 环境影响 ,"COMSOL土壤
- 电力电子Matlab Simulink模块化多电平变换器MMC仿真研究:载波移相PWM、电容电压平衡与环流抑制算法的应用与仿真波形分析(输出相电压、子模块电容电压及电流波形效果),电力电子matlab
- 大厂成熟FOC电机控制代码方案:多功能电动自行车、滑板车专用,基于STM32芯片,多项高级功能一体化解决方案,成熟FOC电机控制代码 大厂成熟FOC电机控制图 可用于电动自行车,滑板 车,电机FOC
- 电池包热管理与新能源汽车共轭传热仿真分析-几何清理网格划分与关键参数设置指南,starccm+电池包热管理-新能源汽车电池包共轭传热仿真 可查學習模型如何搭建,几何清理网格划分,學習重要分析参数如
- 基于MATLAB Simulink R2015b的三相SPWM与THIPWM逆变器仿真模型研究,Three-Phase-SPWM-THIPWM-Inverter:基于MATLAB Simulink的三
- 基于Python的LBPH算法人脸识别系统:使用OpenCV与PyQt5库实现人脸采集与匹配,项目:基于Python的人脸识别 算法:LBPH算法 环境:Windows或linux或mac、pycha
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论0