package View;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import Systems.DataOper;
public class SecondView {
public static JInternalFrame productManagement()
{
JPanel contentPane;
JTextField textField;
JTextField textField_1;
JTextField textField_2;
JTextField textField_3;
JTextField textField_4;
JTextField textField_5;
JTextField textField_6;
JTextField textField_7;
JTextField textField_8;
JInternalFrame frame = new JInternalFrame("商品信息管理");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setBounds(0, 80, 804, 506);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
frame.setContentPane(contentPane);
contentPane.setLayout(null);
JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
tabbedPane.setBounds(0, 0, 772, 418);
contentPane.add(tabbedPane);
JPanel panel = new JPanel();
panel.setLayout(null);
panel.setBackground(Color.LIGHT_GRAY);
tabbedPane.addTab("删除商品", null, panel, null);
JLabel label = new JLabel("商品ID:");
label.setFont(new Font("宋体", Font.PLAIN, 20));
label.setBounds(65, 26, 79, 20);
panel.add(label);
JLabel label_1 = new JLabel("名称:");
label_1.setFont(new Font("宋体", Font.PLAIN, 20));
label_1.setBounds(60, 72, 66, 20);
panel.add(label_1);
JLabel label_2 = new JLabel("价格:");
label_2.setFont(new Font("宋体", Font.PLAIN, 20));
label_2.setBounds(65, 117, 79, 20);
panel.add(label_2);
JLabel label_3 = new JLabel("种类:");
label_3.setFont(new Font("宋体", Font.PLAIN, 20));
label_3.setBounds(65, 163, 61, 20);
panel.add(label_3);
JLabel label_4 = new JLabel("数量:");
label_4.setFont(new Font("宋体", Font.PLAIN, 20));
label_4.setBounds(65, 209, 61, 20);
panel.add(label_4);
JLabel label_5 = new JLabel("供应商:");
label_5.setFont(new Font("宋体", Font.PLAIN, 20));
label_5.setBounds(65, 258, 79, 20);
panel.add(label_5);
JComboBox comboBox = new JComboBox();//商品ID下拉框
comboBox.setBounds(154, 16, 581, 41);
//加入商品ID
comboBox.addItem("");
try {
for(String a : DataOper.getProductID())
comboBox.addItem(a);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
panel.add(comboBox);
comboBox.getSelectedItem();
textField = new JTextField();//名称栏
textField.setColumns(10);
textField.setBounds(154, 61, 581, 41);
panel.add(textField);
textField_1 = new JTextField();//价格栏
textField_1.setColumns(10);
textField_1.setBounds(154, 107, 581, 41);
textField_1.addKeyListener(new JudgeOfisNumdouble());
panel.add(textField_1);
textField_2 = new JTextField();//种类栏
textField_2.setColumns(10);
textField_2.setBounds(154, 153, 581, 41);
panel.add(textField_2);
textField_3 = new JTextField();//数量栏
textField_3.setColumns(10);
textField_3.setBounds(154, 202, 581, 41);
textField_3.addKeyListener(new JudgeOfisNumINT());
panel.add(textField_3);
JTextField T = new JTextField();//供应商
T.setBounds(154, 248, 581, 41);
panel.add(T);
JButton button = new JButton("核实");
button.setFont(new Font("宋体", Font.PLAIN, 32));
button.setBackground(Color.LIGHT_GRAY);
button.setBounds(36, 315, 118, 43);
button.addActionListener(new ActionListener() {//核实按钮监听器
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stu
if(Judge.JudgeOfproducts(comboBox.getSelectedItem().toString(),
textField.getText(), textField_1.getText(), textField_2.getText(), T.getText(), textField_3.getText()))
JOptionPane.showConfirmDialog(null, "信息核实无误", "提示", JOptionPane.CLOSED_OPTION);
else
JOptionPane.showConfirmDialog(null, "信息核实有误", "提示", JOptionPane.CLOSED_OPTION);
}
});
panel.add(button);
JButton button_1 = new JButton("重置");
button_1.setFont(new Font("宋体", Font.PLAIN, 32));
button_1.setBackground(Color.LIGHT_GRAY);
button_1.setBounds(180, 315, 118, 43);
button_1.addActionListener(new ActionListener() {//重置按钮监听器
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
ResultSet rs = null;
try {
rs = DataOper.getProductIFM(comboBox.getSelectedItem().toString());
if(rs==null) {
textField.setText("");
textField_1.setText("");
textField_2.setText("");
textField_3.setText("");
T.setText("");
return;
}
while(rs.next())
{
textField.setText(rs.getString(2));
textField_1.setText(""+rs.getDouble(3));
textField_2.setText(""+rs.getString(4));
textField_3.setText(""+rs.getInt(6));
T.setText(DataOper.getSuplierName(""+rs.getInt(5)));
}
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
});
panel.add(button_1);
JButton button_2 = new JButton("修改");
button_2.setFont(new Font("宋体", Font.PLAIN, 32));
button_2.setBackground(Color.LIGHT_GRAY);
button_2.setBounds(324, 315, 118, 43);
panel.add(button_2);
button_2.addActionListener(new ActionListener() {//修改按钮监听器
@Override
public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub
try {
DataOper.updataPro(comboBox.getSelectedItem().toString(),
textField.getText(), textField_1.getText(),
textField_2.getText(),DataOper.UseSupNameFindSup_ID(T.getText()),textField_3.getText());
JOptionPane.showConfirmDialog(null, "修改成功", "提示", JOptionPane.CLOSED_OPTION);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
JButton button_3 = new JButton("删除");
button_3.setFont(new Font("宋体", Font.PLAIN, 32));
button_3.setBackground(Color.LIGHT_GRAY);
button_3.setBounds(466, 315, 118, 43);
panel.add(button_3);
button_3.addActionListener(new ActionListener() {//删除按钮监听器
@Override
public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub
if(Judge.JudgeOfproducts(comboBox.getSelectedItem().toString(),
textField.getText(), textField_1.getText(), textField_2.getText(), T.getText(), textField_3.getText()))
{
DataOper.DelprodUSEID(comboBox.getSelectedItem().toString());
JOptionPane.showConfirmDialog(null, "删除成功", "提示", JOptionPane.CLOSED_OPTION);
comboBox.removeItem(comboBox.getSelectedItem().toString());
}
else
JOptionPane.showConfirmDialog(null, "信息核实有误", "提示", JOptionPane.CLOSED_OPTION);
}
});
JPanel panel_1 = new JPanel();
panel_1.setLayout(null);
panel_1.setBackground(Color.LIGHT_GRAY);
tabbedPane.addTab("添加商品", null, panel_1, null);
JLabel label_6 = new JLabel("商品ID:");
label_6.setFont(new Font("宋体", Font.PLAIN, 20));
label_6.setBounds(65, 26, 79, 20);
panel_1.add(label_6);
JLabel label_7 = new JLabel("名称:");
l
没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
收起资源包目录
2016_12_仓库管理系统_JAVA版_带界面.zip (99个子文件)
CurriculumDesign
jgoodies-common-1.8.0.jar 44KB
bin
Systems
DataOper.class 11KB
MySQLUtil.class 2KB
config.properties 114B
View
SecondView$33.class 797B
SecondView$9.class 2KB
SecondView$34.class 1KB
MainView$6.class 3KB
SecondView$27.class 996B
SecondView$18.class 2KB
MainView$1.class 3KB
Login$3.class 643B
SecondView$4.class 2KB
SecondView$13.class 2KB
MainView$2.class 3KB
SecondView$1.class 2KB
SecondView$19.class 2KB
SecondView$35.class 795B
SecondView$24.class 2KB
SecondView$32.class 1024B
SecondView$15.class 2KB
SecondView$8.class 1KB
JudgeOfisNumINT.class 782B
SecondView$20.class 1KB
SecondView$37.class 1024B
SecondView$7.class 2KB
SecondView$2.class 2KB
SecondView$25.class 992B
JudgeOfisNumdouble.class 800B
MainView$8.class 3KB
SecondView$29.class 3KB
MainView$4.class 3KB
SecondView$22.class 2KB
SecondView$31.class 2KB
SecondView$3.class 2KB
SecondView$30.class 1KB
Login$2.class 2KB
SecondView$36.class 2KB
SecondView$28.class 1KB
SecondView$5.class 2KB
Login$1.class 692B
MainView.class 8KB
SecondView$14.class 2KB
Judge.class 4KB
SecondView$16.class 1KB
MainView$5.class 3KB
SecondView$17.class 788B
MainView$7.class 3KB
SecondView$23.class 2KB
SecondView$6.class 1KB
SecondView.class 25KB
SecondView$10.class 2KB
SecondView$12.class 2KB
SecondView$11.class 2KB
SecondView$26.class 996B
MainView$9.class 1KB
Login.class 4KB
SecondView$21.class 789B
MainView$3.class 3KB
jgoodies-common-1.8.0-sources.jar 80KB
.settings
org.eclipse.core.resources.prefs 68B
org.eclipse.jdt.core.prefs 598B
jgoodies-forms-1.8.0.jar 129KB
src
Systems
MySQLUtil.java 1KB
DataOper.java 12KB
config.properties 114B
View
SecondView.java 57KB
MainView.java 27KB
Login.java 5KB
Judge.java 3KB
.project 392B
jgoodies-forms-1.8.0-sources.jar 170KB
.classpath 599B
lib
mysql-connector-java-5.1.39-bin.jar 966KB
pict
czygl3.png 5KB
czygl1.png 5KB
xsd3.png 5KB
spxxgl1.png 6KB
ggmm3.png 5KB
spcx2.png 5KB
spxxgl3.png 6KB
jhd3.png 5KB
jhd2.png 5KB
jhd1.png 5KB
welcome.jpg 55KB
ggmm1.png 5KB
spxxgl2.png 6KB
gyscx1.png 6KB
gysxxgl1.png 6KB
gysxxgl3.png 6KB
ggmm2.png 5KB
spcx1.png 5KB
gysxxgl2.png 6KB
czygl2.png 5KB
xsd1.png 5KB
xsd2.png 5KB
spcx3.png 5KB
gyscx3.png 5KB
gyscx2.png 6KB
共 99 条
- 1
qq_39254836
- 粉丝: 10
- 资源: 30
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1