1、企业进销存管理系统主菜单界面上课讲义package com.lzw;import java.awt.*;import java.util.Date;import javax.swing.*;import javax.swing.border.BevelBorder;import com.lzw.login.LoginDialog;public class MainFrame extends JFrame private static final long serialVersionUID = 1L; private JPanel frameContentPane = null; private
2、 MenuBar frameMenuBar = null; private ToolBar toolBar = null; private DesktopPanel desktopPane = null; private JPanel statePanel = null; private JLabel stateLabel = null; private JLabel nameLabel = null; private JLabel nowDateLabel = null; private JSeparator jSeparator1 = null; private static JLabel
3、 czyStateLabel = null; private JSeparator jSeparator2 = null; /* * This method initializes jJToolBarBar * * return javax.swing.JToolBar */ private ToolBar getJJToolBarBar() if (toolBar = null) toolBar = new ToolBar(getFrameMenuBar(); toolBar.setCursor(new Cursor(Cursor.HAND_CURSOR); return toolBar;
4、/* * 初始化窗体菜单栏的方法 * * return javax.swing.JMenuBar */ protected MenuBar getFrameMenuBar() if (frameMenuBar = null) frameMenuBar = new MenuBar(getDesktopPane(), getStateLabel(); return frameMenuBar; /* * This method initializes desktopPane * * return javax.swing.JDesktopPane */ private DesktopPanel get
5、DesktopPane() if (desktopPane = null) desktopPane = new DesktopPanel(); return desktopPane; /* * This method initializes statePanel * * return javax.swing.JPanel */ private JPanel getStatePanel() if (statePanel = null) GridBagConstraints gridBagConstraints6 = new GridBagConstraints(); gridBagConstra
6、ints6.gridx = 2; gridBagConstraints6.fill = GridBagConstraints.VERTICAL; gridBagConstraints6.insets = new Insets(0, 5, 0, 5); gridBagConstraints6.gridy = 0; GridBagConstraints gridBagConstraints4 = new GridBagConstraints(); gridBagConstraints4.gridx = 3; gridBagConstraints4.gridy = 0; GridBagConstra
7、ints gridBagConstraints3 = new GridBagConstraints(); gridBagConstraints3.gridx = 6; gridBagConstraints3.fill = GridBagConstraints.VERTICAL; gridBagConstraints3.insets = new Insets(0, 5, 0, 5); gridBagConstraints3.gridy = 0; GridBagConstraints gridBagConstraints11 = new GridBagConstraints(); gridBagC
8、onstraints11.gridx = 5; gridBagConstraints11.insets = new Insets(0, 5, 0, 5); gridBagConstraints11.gridy = 0; nowDateLabel = new JLabel(); Date now = new Date(); nowDateLabel.setText(String.format(%tF, now); GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); gridBagConstraints2.gridx
9、 = 7; gridBagConstraints2.weightx = 0.0; gridBagConstraints2.fill = GridBagConstraints.NONE; gridBagConstraints2.gridy = 0; nameLabel = new JLabel(吉林省铭泰有限公司 ); GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); gridBagConstraints1.gridx = 4; gridBagConstraints1.fill = GridBagConstrai
10、nts.VERTICAL; gridBagConstraints1.weighty = 1.0; gridBagConstraints1.insets = new Insets(0, 5, 0, 5); gridBagConstraints1.gridy = 0; GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; gridBagConstra
11、ints.weightx = 1.0; gridBagConstraints.gridy = 0; statePanel = new JPanel(); statePanel.setLayout(new GridBagLayout(); statePanel.setBorder(BorderFactory .createBevelBorder(BevelBorder.RAISED); statePanel.add(getStateLabel(), gridBagConstraints); statePanel.add(getJSeparator(), gridBagConstraints1);
12、 statePanel.add(nameLabel, gridBagConstraints2); statePanel.add(getJSeparator1(), gridBagConstraints3); statePanel.add(nowDateLabel, gridBagConstraints11); statePanel.add(getCzyStateLabel(), gridBagConstraints4); statePanel.add(getJSeparator2(), gridBagConstraints6); return statePanel; public static
13、 JLabel getCzyStateLabel() if (czyStateLabel = null) czyStateLabel = new JLabel(操作员:); return czyStateLabel; public JLabel getStateLabel() if (stateLabel = null) stateLabel = new JLabel(); stateLabel.setText(当前没有选定窗体); return stateLabel; /* * This method initializes jSeparator * * return javax.swing
14、.JSeparator */ private JSeparator getJSeparator() JSeparator jSeparator = new JSeparator(); jSeparator.setOrientation(JSeparator.VERTICAL); return jSeparator; /* * This method initializes jSeparator1 * * return javax.swing.JSeparator */ private JSeparator getJSeparator1() if (jSeparator1 = null) jSe
15、parator1 = new JSeparator(); jSeparator1.setOrientation(SwingConstants.VERTICAL); return jSeparator1; /* * This method initializes jSeparator2 * * return javax.swing.JSeparator */ private JSeparator getJSeparator2() if (jSeparator2 = null) jSeparator2 = new JSeparator(); jSeparator2.setOrientation(S
16、wingConstants.VERTICAL); return jSeparator2; /* * param args */ public static void main(String args) SplashScreen splashScreen = SplashScreen.getSplashScreen(); if(splashScreen!=null) try JFrame login = new LoginDialog(); login.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Thread.sleep(3000); logi
17、n.setVisible(true); catch (InterruptedException e) /* * This is the default constructor */ public MainFrame() super(); initialize(); /* * This method initializes this * * return void */ private void initialize() (3) 心态问题 this.setSize(800, 600);二、资料网址: this.setJMenuBar(getFrameMenuBar(); this.setCont
18、entPane(getFrameContentPane();培养动手能力 学一门手艺 打发时间 兴趣爱好 this.setTitle(铭泰企业进销存管理系统);附件(二): /* * This method initializes frameContentPane * “碧芝”最吸引人的是那些小巧的珠子、亮片等,都是平日里不常见的。店长梁小姐介绍,店内的饰珠有威尼斯印第安的玻璃珠、秘鲁的陶珠、奥利的施华洛世奇水晶、法国的仿金片、日本的梦幻珠等,五彩缤纷,流光异彩。按照饰珠的质地可分为玻璃、骨质、角质、陶制、水晶、仿金、木制等种类,其造型更是千姿百态:珠型、圆柱型、动物造型、多边形、图腾形象等,
19、美不胜收。全部都是进口的,从几毛钱一个到几十元一个的珠子,做一个成品饰物大约需要几十元,当然,还要决定于你的心意。“碧芝”提倡自己制作:端个特制的盘子到柜台前,按自己的构思选取喜爱的饰珠和配件,再把它们串成成品。这里的饰珠和配件的价格随质地而各有同,所用的线绳价格从几元到一二十元不等,如果让店员帮忙串制,还要收取的手工费。 * return javax.swing.JPanel他们的成功秘诀在于“连锁”二字。凭借“连锁”,他们在女孩们所喜欢的小玩意上玩出了大名堂。小店连锁,优势明显,主要有: */ private JPanel getFrameContentPane() 中式饰品风格的饰品绝对
20、不拒绝采用金属,而且珠子的种类也更加多样。 五光十色的水晶珠、仿古雅致的嵌丝珐琅珠、充满贵族气息的景泰蓝珠、粗糙前卫的金属字母珠片的材质也多种多样。 if (frameContentPane = null) 在上海, 随着轨道交通的发展,地铁商铺应运而生,并且在重要商圈已经形成一定的气候,投资经营地铁商铺逐渐为一大热门。在人民广场地下的迪美购物中心,有一家DIY自制饰品店-“碧芝自制饰品店” frameContentPane = new JPanel(); frameContentPane.setLayout(new BorderLayout(); frameContentPane.add(g
21、etStatePanel(), BorderLayout.SOUTH); frameContentPane.add(getJJToolBarBar(), BorderLayout.NORTH);开了连锁店,最大的好处是让别人记住你。“漂亮女生”一律采用湖蓝底色的装修风格,简洁、时尚、醒目。“品牌效应”是商家梦寐以求的制胜法宝 。 frameContentPane.add(getDesktopPane(), BorderLayout.CENTER);(一)上海的经济环境对饰品消费的影响 return frameContentPane; / jve:decl-index=0:visual-constraint=6,-5
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1