python仓库管理系统开源_Java课程设计仓库管理系统(附源
码)
packagecom.szss.mainFrame;import
staticjavax.ateTitledBorder;importjava.awt.Color;importjava.awt.EventQueue;importjava.awt.Font;importjavax class RemoveButtomFrame extendsJFrame {privateMyJPanel contentPane;privateBGPanel backPanel;private
SmallScrollPanel moduleButtonGroup = null;privateJTree tree;privateJPanel panel;
FeelWarePanel panelFeel= newFeelWarePanel();
JPanel panel_1= newJPanel();
JLabel fristLabel= new JLabel("基本档案管理");private BGPanel jPanel = null;private ButtonGroup buttonGroup = null;private GlassButton workSpaceButton = null;private GlassButton progressButton = null;private GlassButton bookProjectButton =
null;private GlassButton chukuButton = null;private GlassButton personnelManagerButton = null;private GlassButton deptManagerButton = null;
JLabel label_1= new JLabel("您当前的位置是:");/*** Create the frame.*/
publicRemoveButtomFrame() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 934, 625);
contentPane= newMyJPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.add(getModuleButtonGroup());
setTitle("三只松⿏管理系统");
contentPane.setLayout(null);
setResizable(false);
JPanel clockpanel= newJPanel();
clockpanel.setBackground(new Color(255,175,175));
clockpanel.setBounds(10, 120, 248, 130);
contentPane.add(clockpanel);
clockpanel.setLayout(null);
JPanel panel_1= newJPanel();
panel_1.setBounds(0, 210, 276, 1);
clockpanel.add(panel_1);
panel_1.setLayout(null);
User user= User(); //获取登录⽤户对象
String info = "
" + " "
+ "" + UserName() + ""
+ "" + ""; //定义窗体显⽰内容
JLabel label= new JLabel(info); //定义显⽰指定内容的标签对象
label.llow);
label.setBounds(70, 30, 128, 35);
clockpanel.add(label);
contentPane.add(getContentPanel());//在主窗体中添加
}privateBGPanel getContentPanel() {if (backPanel == null) {
backPanel= newBGPanel();
backPanel.setBackground(new Color(255,175,175));
backPanel.setSize(629, 416); //内容显⽰区主⾯板
backPanel.setLocation(279, 149);
backPanel.setLayout(null);
label_1.setHorizontalAlignment(SwingConstants.RIGHT);
label_1.setVerticalAlignment(SwingConstants.BOTTOM);
label_1.setBounds(38, 38, 96, 15);
backPanel.setBorder(createTitledBorder(null, "基本档案管理",
TitledBorder.DEFAULT_JUSTIFICATION,
TitledBorder.TOP,new Font("sansserif", Font.BOLD,12), new Color(59, 59, 59))); backPanel.add(label_1);
fristLabel.setBounds(133, 38, 123, 15);
backPanel.add(fristLabel);
panel_1.setBounds(10, 63, 611, 343);
panel_1.setLayout(null);
backPanel.add(panel_1);
JScrollPane scrollPane= newJScrollPane();
panel_1.add(scrollPane);
JScrollPane scrollPane_1= newJScrollPane();
scrollPane_1.setBackground(new Color(255,175,175));
scrollPane_1.setBounds(0, 0, 138, 334);
panel_1.add(scrollPane_1);
DefaultMutableTreeNode rootNode= newDefaultMutableTreeNode("基本档案管理"); DefaultMutableT
reeNode childNode1= newDefaultMutableTreeNode("供货商管理"); DefaultMutableTreeNode childNode2= newDefaultMutableTreeNode("销售商管理"); DefaultMutableTreeNode childNode3= newDefaultMutableTreeNode("货品档案管理");
DefaultMutableTreeNode childNode4= newDefaultMutableTreeNode("仓库管理"); rootNode.add(childNode1);
rootNode.add(childNode2);
rootNode.add(childNode3);
rootNode.add(childNode4);
tree= newJTree(rootNode);
scrollPane_1.setColumnHeaderView(tree);final JPanel sellPanel = newJPanel(); sellPanel.setBackground(new Color(255,175,175));
sellPanel.setBounds(138, 0, 473, 343);
sellPanel.setLayout(null);
panel_1.add(sellPanel);
TreeSelectionModel.SINGLE_TREE_SELECTION);
TreeSelectionModel SelectionModel();
treeSelectionModel
.setSelectionMode(TreeSelectionModel.CONTIGUOUS_TREE_SELECTION);
tree.addTreeSelectionListener(newTreeSelectionListener() {
@Overridepublic voidvalueChanged(TreeSelectionEvent e) {if (!tree.isSelectionEmpty()) { TreePath SelectionPath();
Object LastPathComponent();
DefaultMutableTreeNode node=(DefaultMutableTreeNode) path;
String userObject=(String) UserObject();
repaint();if (userObject.equals("供货商管理")) {
fristLabel.setText("供货商管理");
sellPanel.Message());
}else if (userObject.equals("销售商管理")) {
fristLabel.setText("销售商管理");
SellPanel sell= newSellPanel();
sellPanel.Message());
repaint();
}else if (userObject.equals("货品档案管理")) {
fristLabel.setText("货品档案管理");
WarePanel warePanel= newWarePanel();
sellPanel.Message());
repaint();
}else if (userObject.equals("仓库管理")) {
fristLabel.setText("仓库管理");
DepotPanel depotPanel= newDepotPanel();
sellPanel.Message());
repaint();
}
}
}
});
}returnbackPanel;
}privateSmallScrollPanel getModuleButtonGroup() {if (moduleButtonGroup == null) { moduleButtonGroup= new SmallScrollPanel();//创建移动⾯板
moduleButtonGroup.setBounds(250, 20, 434, 68);
moduleButtonGroup.setOpaque(false);//将按钮组⾯板作为移动⾯板的视图moduleButtonGroup.setViewportView(getJPanel());
.setViewportView(getJPanel());//添加⿏标事件
}returnmoduleButtonGroup;
}publicBGPanel getJPanel() {if (jPanel == null) {
GridLayout gridLayout= new GridLayout(); //定义⽹格布局管理器
gridLayout.setRows(1); //设置⽹格布局管理器的⾏数
gridLayout.setHgap(0); //设置组件间⽔平间距
gridLayout.setVgap(0); //设置组件间垂直间距htmlborder
jPanel = new BGPanel(); //
//设置布局管理器
jPanel.setLayout(gridLayout);//设置初始⼤⼩
jPanel.setPreferredSize(new Dimension(400, 50));
jPanel.setOpaque(false);//添加按钮
jPanel.add(getWorkSpaceButton(), null);
jPanel.add(getProgressButton(),null);
jPanel.add(getrukuButton(),null);
jPanel.add(getchukuButton(),null);
jPanel.add(getPersonnelManagerButton(),null);
jPanel.add(getDeptManagerButton(),null);if (buttonGroup == null) {
buttonGroup= newButtonGroup();
}//把所有按钮添加到⼀个组控件中
buttonGroup.add(getProgressButton());
buttonGroup.add(getWorkSpaceButton());
buttonGroup.add(getrukuButton());
buttonGroup.add(getchukuButton());
buttonGroup.add(getPersonnelManagerButton());
buttonGroup.add(getDeptManagerButton());
}returnjPanel;
}//基本档案管理按钮
privateGlassButton getWorkSpaceButton() {if (workSpaceButton == null) {
workSpaceButton= newGlassButton();
workSpaceButton.setActionCommand("基本档案管理"); //设置按钮的动作命令
workSpaceButton.setIcon(newImageIcon(getClass().getResource("/com/szss/frame/buttonIcons/myWorkSpace.png"))); //定义按钮的初始化背景
ImageIcon icon = newImageIcon(getClass().getResource("/com/szss/frame/buttonIcons/myWorkSpace2.png")); //创建
图⽚对象
workSpaceButton.setRolloverIcon(icon); //设置按钮的翻转图⽚
workSpaceButton.setSelectedIcon(icon); //设置按钮被选中时显⽰图⽚
workSpaceButton.setSelected(true);
workSpaceButton.addActionListener(new toolsButtonActionAdapter()); //按钮的
}returnworkSpaceButton;
}//采购进货管理按钮
privateGlassButton getProgressButton() {if (progressButton == null) {
progressButton= newGlassButton();
progressButton.setActionCommand("采购进货");
progressButton.setText("");
progressButton.setIcon(newImageIcon(getClass().getResource("/com/szss/frame/buttonIcons/caigou1.png")));
ImageIcon icon= newImageIcon(getClass().getResource("/com/szss/frame/buttonIcons/caigou2.png"));
progressButton.setRolloverIcon(icon);

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。