📄 asmainmenu.java
字号:
package com.aptech.cdjj.sex.gui;
/**
* <p>Title: 采界库存面</p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2007</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0*/
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import java.text.*;
import java.util.*;
import java.util.Date;
import javax.swing.*;
import javax.swing.event.*;
import com.aptech.cdjj.sex.action.*;
import com.aptech.cdjj.sex.database.SDBManager;
import javax.swing.table.DefaultTableModel;
import javax.swing.tree.DefaultMutableTreeNode;
import java.awt.Rectangle;
import javax.swing.border.TitledBorder;
import javax.swing.BorderFactory;
import java.awt.Color;
import java.awt.BorderLayout;
import javax.swing.border.Border;
import java.awt.Font;
import javax.swing.tree.DefaultTreeModel;
public class ASMainMenu extends JFrame implements Runnable{
ASMainMenu() {
try {
setDefaultCloseOperation(EXIT_ON_CLOSE);
jbInit();
jbInit1();
getNumber() ;
} catch (Exception ex) {
ex.printStackTrace();
}
this.setExtendedState(this.MAXIMIZED_BOTH);
this.jTable1.getTableHeader().setReorderingAllowed(false);
this.jTable1.setAutoResizeMode(jTable1.AUTO_RESIZE_OFF);
this.setSize(750, 575);
this.setVisible(true);
}
public static void main(String[] args) {
ASMainMenu asmainnenu = new ASMainMenu();
Thread thr = new Thread(asmainnenu);
thr.start();
}
private void jbInit() throws Exception {
this.getContentPane().setLayout(null); //容器类情况
jPanel1.setLayout(null);
jPanel2.setBorder(BorderFactory.createEtchedBorder());
jPanel2.setBounds(new Rectangle(0, 665, 1078, 25));
jPanel2.setLayout(gridLayout2);
jSplitPane1.setOneTouchExpandable(true);
jSplitPane1.setBounds(new Rectangle( -2, 30, 1032, 635));
jSplitPane1.setDividerLocation(150);
jSplitPane2.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
jSplitPane2.setOrientation(JSplitPane.VERTICAL_SPLIT);
jSplitPane2.setDividerLocation(230);
jSplitPane2.setOneTouchExpandable(true);
jTextField1.setBackground(Color.gray);
jTextField1.setEnabled(false);
jTextField1.setText("Aptech成都锦江培训中心(S1T013--SEX小组)");
jTextField2.setBackground(Color.gray);
jTextField2.setEnabled(false);
jTextField2.setText("操作员: " + SLoginMenu.name + " (" + SLoginMenu.step + ")");
jTextField3.setBackground(Color.gray);
jTextField3.setEnabled(false);
jPanel3.setLayout(null);
jPanel3.addMouseListener(new ASMainMenu_jPanel3_mouseAdapter(this));
jPanel4.setBorder(BorderFactory.createEtchedBorder());
jPanel4.setBounds(new Rectangle( -2, 0, 1025, 29));
jPanel4.setLayout(gridLayout1);
jButton1.setBackground(Color.lightGray);
jButton1.setText("基础信息");
jButton1.addActionListener(new ASMainMenu_jButton1_actionAdapter(this));
jButton2.setBackground(Color.lightGray);
jButton2.setText("库存信息");
jButton3.setBackground(Color.lightGray);
jButton3.setText("销售信息");
jButton3.addActionListener(new ASMainMenu_jButton3_actionAdapter(this));
jButton4.setBackground(Color.lightGray);
jButton4.setText("人员信息");
jButton4.addActionListener(new ASMainMenu_jButton4_actionAdapter(this));
jButton5.setBackground(Color.lightGray);
jButton5.setText("客户信息");
jButton5.addActionListener(new ASMainMenu_jButton5_actionAdapter(this));
jButton6.setBackground(Color.lightGray);
jButton6.setText("返回");
jButton6.addActionListener(new ASMainMenu_jButton6_actionAdapter(this));
jMenuItem17.setText("客户信息");
jMenuItem17.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,
InputEvent.CTRL_MASK));
jMenuItem17.addActionListener(new ASMainMenu_jMenuItem17_actionAdapter(this));
jMenu2.setText("珠宝品种(V)");
jMenu2.setMnemonic('V');
jMenuItem6.setText("人员查询");
jMenuItem6.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y,
InputEvent.CTRL_MASK));
jMenuItem6.addActionListener(new ASMainMenu_jMenuItem6_actionAdapter(this));
jMenu8.setText("宝石(B)");
jMenu8.setIcon(new ImageIcon("F:/Jewelry/pic/CR.JPG"));
jMenu8.setMnemonic('B');
jMenuItem4.setText("钻石");
jMenuItem4.setIcon(new ImageIcon("F:/Jewelry/pic/YDL.JPG"));
jMenuItem4.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D,
InputEvent.CTRL_MASK));
jMenuItem9.setText("翡翠");
jMenuItem9.setIcon(new ImageIcon("F:/Jewelry/pic/MB.JPG"));
jMenuItem9.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F,
InputEvent.CTRL_MASK));
jMenuItem10.setText("玛瑙");
jMenuItem10.setIcon(new ImageIcon("F:/Jewelry/pic/SGSS.JPG"));
jMenuItem12.setText("珍珠");
jMenuItem12.setIcon(new ImageIcon("F:/Jewelry/pic/HB.JPG"));
jMenuItem18.setText("红宝石");
jMenuItem18.setIcon(new ImageIcon("F:/Jewelry/pic/CR.JPG"));
jMenuItem18.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_H,
InputEvent.CTRL_MASK));
jMenuItem19.setText("蓝宝石");
jMenuItem19.setIcon(new ImageIcon("F:/Jewelry/pic/MDL.jpg"));
jMenu9.setText("金银(C)");
jMenu9.setIcon(new ImageIcon("F:/Jewelry/pic/QR.JPG"));
jMenu9.setMnemonic('C');
jMenuItem5.setText("铂金");
jMenuItem5.setIcon(new ImageIcon("F:/Jewelry/pic/BBS.JPG"));
jMenuItem20.setText("18k金");
jMenuItem20.setIcon(new ImageIcon("F:/Jewelry/pic/RXL.JPG"));
jMenuItem14.setText("黄金");
jMenuItem21.setText("白银");
jPanel5.setBorder(BorderFactory.createEtchedBorder());
jPanel5.setBackground(Color.lightGray);
jPanel5.setBounds(new Rectangle(21, 16, 802, 313));
jPanel5.setLayout(null);
jButton7.setBounds(new Rectangle(405, 23, 100, 24));
jButton7.setText("种 类");
jButton7.addActionListener(new ASMainMenu_jButton7_actionAdapter(this));
jPanel1.setBounds(new Rectangle(4, 4, 1023, 696));
jButton8.setBounds(new Rectangle(573, 23, 95, 24));
jButton8.setText("价格");
jButton8.addActionListener(new ASMainMenu_jButton8_actionAdapter(this));
jButton9.setBounds(new Rectangle(245, 23, 98, 24));
jButton9.setText("编 号");
jButton9.addActionListener(new ASMainMenu_jButton9_actionAdapter(this));
jPanel7.setBackground(Color.lightGray);
jPanel7.setBorder(BorderFactory.createLineBorder(Color.black));
jPanel7.setBounds(new Rectangle(21, 337, 802, 282));
jPanel7.setLayout(null);
jPanel7.setBorder(BorderFactory.createTitledBorder(BorderFactory.
createLineBorder(Color.black, 1),
"采购入库单填写信息", TitledBorder.LEFT, TitledBorder.TOP));
jLabel3.setText("物品单位:");
jLabel3.setBounds(new Rectangle(60, 191, 68, 23));
jLabel4.setText("珠宝名称:");
jLabel4.setBounds(new Rectangle(235, 35, 66, 23));
jLabel5.setText("销售价格:");
jLabel5.setBounds(new Rectangle(261, 150, 73, 23));
jLabel6.setText("大 类:");
jLabel6.setBounds(new Rectangle(61, 110, 52, 26));
jLabel7.setText("珠宝编号:");
jLabel7.setBounds(new Rectangle(61, 34, 68, 24));
jLabel8.setText("珠宝产地:");
jLabel8.setBounds(new Rectangle(235, 75, 67, 23));
jLabel9.setText("成本价格:");
jLabel9.setBounds(new Rectangle(61, 149, 71, 24));
txtPrice2.setBackground(Color.lightGray);
txtPrice2.setEnabled(false);
txtPrice2.setBorder(border1);
txtPrice2.setHorizontalAlignment(txtPrice2.RIGHT);
txtPrice2.setBounds(new Rectangle(137, 147, 83, 26));
jComboBox1.setBounds(new Rectangle(127, 110, 89, 22));
jComboBox1.addActionListener(new ASMainMenu_jComboBox1_actionAdapter(this));
jComboBox2.setBounds(new Rectangle(298, 110, 95, 22));
jComboBox1.setBackground(Color.lightGray);
jComboBox1.setEnabled(false);
jComboBox1.setBorder(border1);
jComboBox1.setModel(new DefaultComboBoxModel(SDBManager.getOne("select bigs from big")));
jComboBox2.setBackground(Color.lightGray);
jComboBox2.setEnabled(false);
jComboBox2.setBorder(border1);
jComboBox2.setModel(new DefaultComboBoxModel(SDBManager.getOne("select smalls from small where bigs = '宝石'")));
jLabel12.setText("重量/纯度:");
jLabel12.setBounds(new Rectangle(237, 190, 69, 23));
jLabel13.setToolTipText("");
jLabel13.setText("入库时间:");
jLabel13.setBounds(new Rectangle(408, 35, 69, 23));
jButton10.setBounds(new Rectangle(631, 184, 105, 27));
jButton10.setText("提 交");
jButton10.addActionListener(new ASMainMenu_jButton10_actionAdapter(this));
jButton11.setBounds(new Rectangle(631, 226, 105, 27));
jButton11.setText("增加入库单");
jButton11.addActionListener(new ASMainMenu_jButton11_actionAdapter(this));
jScrollPane2.setHorizontalScrollBarPolicy(JScrollPane.
HORIZONTAL_SCROLLBAR_ALWAYS);
jScrollPane2.setVerticalScrollBarPolicy(JScrollPane.
VERTICAL_SCROLLBAR_ALWAYS);
jScrollPane2.setBounds(new Rectangle(18, 53, 769, 249));
jPanel6.setBackground(Color.lightGray);
jPanel6.setBorder(BorderFactory.createEtchedBorder());
jPanel6.setBounds(new Rectangle(622, 29, 124, 135));
jPanel6.setLayout(null);
jRadioButton1.setBackground(Color.gray);
jRadioButton1.setText("删 除");
jRadioButton1.setBounds(new Rectangle(26, 49, 77, 29));
jRadioButton1.addActionListener(new
ASMainMenu_jRadioButton1_actionAdapter(this));
jRadioButton2.setBackground(Color.gray);
jRadioButton2.setText("增 加");
jRadioButton2.setBounds(new Rectangle(26, 10, 77, 29));
jRadioButton2.addActionListener(new
ASMainMenu_jRadioButton2_actionAdapter(this));
jRadioButton3.setBackground(Color.gray);
jRadioButton3.setText("更 改");
jRadioButton3.setBounds(new Rectangle(26, 87, 77, 29));
jRadioButton3.addActionListener(new
ASMainMenu_jRadioButton3_actionAdapter(this));
jComboBox3.setBounds(new Rectangle(477, 110, 94, 21));
jComboBox3.setBackground(Color.lightGray);
jComboBox3.setEnabled(false);
jComboBox3.setBorder(border1);
jComboBox3.setModel(new DefaultComboBoxModel(SDBManager.getOne("select styles from style")));
jLabel15.setToolTipText("");
jLabel15.setText("小 类:");
jLabel15.setBounds(new Rectangle(237, 106, 52, 26));
jLabel16.setText("款 式:");
jLabel16.setBounds(new Rectangle(408, 105, 54, 26));
txtTime.setBackground(Color.cyan);
txtTime.setEnabled(false);
txtTime.setBorder(BorderFactory.createRaisedBevelBorder());
txtTime.setDisabledTextColor(Color.blue);
txtTime.setBounds(new Rectangle(477, 35, 94, 23));
txtPrice.setBackground(Color.lightGray);
txtPrice.setEnabled(false);
txtPrice.setBorder(border1);
txtPrice.setHorizontalAlignment(txtPrice.RIGHT);
txtPrice.setBounds(new Rectangle(337, 147, 85, 26));
txtID.setBackground(Color.cyan);
txtID.setEnabled(false);
txtID.setBorder(BorderFactory.createRaisedBevelBorder());
txtID.setDisabledTextColor(Color.blue);
txtID.setEditable(false);
txtID.setBounds(new Rectangle(127, 37, 89, 21));
txtID.addActionListener(new ASMainMenu_txtID_actionAdapter(this));
txtName.setBackground(Color.lightGray);
txtName.setEnabled(false);
txtName.setBorder(border1);
txtName.setBounds(new Rectangle(299, 32, 94, 26));
txtAdd.setBackground(Color.lightGray);
txtAdd.setEnabled(false);
txtAdd.setBorder(border1);
txtAdd.setBounds(new Rectangle(301, 70, 89, 26));
txt1.setBackground(Color.lightGray);
txt1.setEnabled(false);
txt1.setBorder(border1);
txt1.setBounds(new Rectangle(313, 192, 97, 21));
jButton12.setBounds(new Rectangle(101, 22, 86, 25));
jButton12.setText("排 序:");
jButton12.addContainerListener(new ASMainMenu_jButton12_containerAdapter(this));
jTable1.addMouseListener(new ASMainMenu_jTable1_mouseAdapter(this));
jTree1.addMouseListener(new ASMainMenu_jTree1_mouseAdapter(this));
jPanel3.setBackground(Color.gray);
jMenuItem15.addActionListener(new ASMainMenu_jMenuItem15_actionAdapter(this));
jMenuItem16.addActionListener(new ASMainMenu_jMenuItem16_actionAdapter(this));
jLabel2.setText("物品数量:");
jLabel2.setBounds(new Rectangle(61, 72, 68, 23));
txtmath.setBackground(Color.lightGray);
txtmath.setBorder(border1);
txtmath.setBounds(new Rectangle(127, 69, 89, 26));
jComboBox4.setBounds(new Rectangle(127, 191, 89, 22));
jComboBox4.setBackground(Color.lightGray);
jComboBox4.setBorder(border1);
//通过SQL做下拉的菜单 代码来自SDBM.getOne();
jComboBox4.setModel(new DefaultComboBoxModel(SDBManager.getOne("select units from unit")));
jComboBox4.setSelectedIndex(0);
jLabel10.setText("售出数量:");
jLabel10.setBounds(new Rectangle(422, 184, 70, 29));
txtnum.setBackground(Color.cyan);
txtnum.setEnabled(false);
txtnum.setBorder(BorderFactory.createRaisedBevelBorder());
txtnum.setDisabledTextColor(Color.blue);
txtnum.setBounds(new Rectangle(502, 188, 69, 21));
txtashow.setBackground(new Color(125, 0, 0));
txtashow.setEnabled(false);
txtashow.setBorder(BorderFactory.createRaisedBevelBorder());
txtashow.setDisabledTextColor(Color.yellow);
txtashow.setText("环境");
txtashow.setBounds(new Rectangle(59, 236, 512, 31));
jLabel11.setForeground(Color.blue);
jLabel11.setText(".00");
jLabel11.setBounds(new Rectangle(425, 158, 24, 15));
jLabel14.setForeground(Color.blue);
jLabel14.setText(".00");
jLabel14.setBounds(new Rectangle(222, 158, 24, 15));
jMenuItem22.setText("销售分析比列图");
jMenuItem22.addActionListener(new ASMainMenu_jMenuItem22_actionAdapter(this));
jMenuItem7.addActionListener(new ASMainMenu_jMenuItem7_actionAdapter(this));
jMenuItem8.addActionListener(new ASMainMenu_jMenuItem8_actionAdapter(this));
jMenuItem13.addActionListener(new ASMainMenu_jMenuItem13_actionAdapter(this));
jMenuItem11.addActionListener(new ASMainMenu_jMenuItem11_actionAdapter(this));
jMenuItem1.addActionListener(new ASMainMenu_jMenuItem1_actionAdapter(this));
jMenuItem2.addActionListener(new ASMainMenu_jMenuItem2_actionAdapter(this));
jMenuItem3.addActionListener(new ASMainMenu_jMenuItem3_actionAdapter(this));
jTree2.addMouseListener(new ASMainMenu_jTree2_mouseAdapter(this));
jPanel1.add(jPanel4, null);
this.setJMenuBar(jMenuBar1); //菜单栏情况
jMenu1.setText("珠宝数据(D)");
jMenu1.setMnemonic('D');
jMenu3.setText("珠宝入库(K)");
jMenu3.setMnemonic('k');
jMenu4.setText("人员管理(P)");
jMenu4.setMnemonic('P');
jMenu5.setText("珠宝销售(S)");
jMenu5.setMnemonic('S');
jMenu6.setText("客户管理(C)");
jMenu6.setMnemonic('C');
jMenuItem1.setText("基础信息");
jMenu1.setMnemonic('D');
jMenuItem1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -