文件名称:
手机管理系统源代码(虽然简单仅供大家参考)
开发工具:
文件大小: 3mb
下载次数: 0
上传时间: 2009-02-13
详细说明: 一个简单的程序,4个人20天的心血.package zhuyemian; import java.awt.BorderLayout; import java.awt.Cursor; import java.awt.Dimension; import java.awt.Font; import java.awt.Graphics; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JEditorPane; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JMenu; import javax.s wing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JToolBar; import javax.swing.UIManager; import javax.swing.border.EtchedBorder; //import com.qhit.LandAppend; //import com.qhit.PasswordAmend; import Kehuxinxi.Kehumain; import Shouhoumain.Main; import Xiaoshouxinxi.Xiaoshoumain; import Chanpinxinxi.Chanpinmain; public class Zhuyemian extends JFrame implements Runnable{ MyPanel panel = new MyPanel(); JLabel label; public Zhuyemian() { super(); this.setIconImage(new ImageIcon("shoujitubiao.jpg").getImage());//在标题上的图片 this.setTitle("手机销售信息管理");//标题 this.setResizable(false);//大小可否改变 setSize(1024, 768); getContentPane().setLayout(null); getContentPane().add(panel); panel.setBounds(142, 37, 900, 738); panel.setLayout(null); final JMenuBar menuBar = new JMenuBar(); menuBar.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));//设置鼠标形状为默认的箭头 setJMenuBar(menuBar); final JMenu menujibencaozuo = new JMenu(); menujibencaozuo.setText("基本操作"); menuBar.add(menujibencaozuo); final JMenuItem newItemMenuItem_1 = new JMenuItem(); newItemMenuItem_1.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent arg0) { new Kehumain(); } }); newItemMenuItem_1.setText("客户信息"); menujibencaozuo.add(newItemMenuItem_1); final JMenuItem newItemMenuItem = new JMenuItem(); newItemMenuItem.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent arg0) { new Chanpinmain(); } }); newItemMenuItem.setText("产品信息"); menujibencaozuo.add(newItemMenuItem); final JMenuItem newItemMenuItemxiaoshouxinxi = new JMenuItem(); newItemMenuItemxiaoshouxinxi.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent arg0) { new Xiaoshoumain(); } }); newItemMenuItemxiaoshouxinxi.setText("销售信息"); menujibencaozuo.add(newItemMenuItemxiaoshouxinxi); final JMenuItem newItemMenuItemshouhouxinxi = new JMenuItem(); newItemMenuItemshouhouxinxi.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent arg0) { new Main(); } }); newItemMenuItemshouhouxinxi.setText("售后信息"); menujibencaozuo.add(newItemMenuItemshouhouxinxi); final JMenu menugongju = new JMenu(); menugongju.setText("工具"); menuBar.add(menugongju); final JMenuItem newItemMenuItemjisuanqi = new JMenuItem(); newItemMenuItemjisuanqi.setText("计算器"); newItemMenuItemjisuanqi.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { Runtime.getRuntime().exec("calc.exe"); //设置运行任何系统可执行的程序----计算器 } catch (IOException e) { e.printStackTrace(); } } }); menugongju.add(newItemMenuItemjisuanqi); final JMenuItem newItemMenuItemjishiben = new JMenuItem(); newItemMenuItemjishiben.setText("记事本"); newItemMenuItemjishiben.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { Runtime.getRuntime().exec("notepad.exe"); //设置运行任何系统可执行的程序----记事本 } catch (IOException e) { e.printStackTrace(); } } }); menugongju.add(newItemMenuItemjishiben); final JMenu menu = new JMenu(); menu.setText("密码设置"); menuBar.add(menu); final JMenuItem newItemMenuItem_2 = new JMenuItem(); newItemMenuItem_2.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent arg0) { // LandAppend ls = new LandAppend(); } }); newItemMenuItem_2.setText("注册管理员"); menu.add(newItemMenuItem_2); final JMenuItem newItemMenuItem_3 = new JMenuItem(); newItemMenuItem_3.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent arg0) { // PasswordAmend frame = new PasswordAmend(null); } }); newItemMenuItem_3.setText("修改密码"); menu.add(newItemMenuItem_3); final JButton xiaishouxinxi = new JButton(); xiaishouxinxi.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent arg0) { Xiaoshoumain xsm =new Xiaoshoumain(); } }); xiaishouxinxi.setIcon(SwingResourceManager.getIcon(Zhuyemian.class, "/xiaoshouxinxi.jpg")); xiaishouxinxi.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));//设置鼠标形状为默认的箭头 xiaishouxinxi.setBorder(new EtchedBorder(EtchedBorder.LOWERED)); xiaishouxinxi.setText(""); xiaishouxinxi.setBounds(0, 369, 136, 139); getContentPane().add(xiaishouxinxi); final JButton shouhouxinxi = new JButton(); shouhouxinxi.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent arg0) { Main mm=new Main(); } }); shouhouxinxi.setIcon(SwingResourceManager.getIcon(Zhuyemian.class, "/shouhouxinxi.jpg")); shouhouxinxi.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));//设置鼠标形状为默认的箭头 shouhouxinxi.setBorder(new EtchedBorder(EtchedBorder.LOWERED)); shouhouxinxi.setText(""); shouhouxinxi.setBounds(0, 537, 136, 139); getContentPane().add(shouhouxinxi); final JButton chanpinxinxi = new JButton(); chanpinxinxi.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent arg0) { Chanpinmain cpm=new Chanpinmain(); } }); chanpinxinxi.setBounds(0, 202, 136, 134); getContentPane().add(chanpinxinxi); chanpinxinxi.setBorder(new EtchedBorder(EtchedBorder.LOWERED)); chanpinxinxi.setIcon(SwingResourceManager.getIcon(Zhuyemian.class, "/chanpinxinxi.jpg")); chanpinxinxi.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));//设置鼠标形状为默认的箭头 chanpinxinxi.setText(""); final JButton kehuxinxi = new JButton(); kehuxinxi.setBounds(0, 37, 136, 134); getContentPane().add(kehuxinxi); kehuxinxi.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent arg0) { new Kehumain(); } }); kehuxinxi.setIcon(SwingResourceManager.getIcon(Zhuyemian.class, "/kehuxinxi.jpg")); kehuxinxi.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));//设置鼠标形状为默认的箭头 kehuxinxi.setText(""); this.setCursor(new Cursor(Cursor.HAND_CURSOR));//设置鼠标形状为手型 label = new JLabel(); label.setText(""); label.setBounds(805, 0, 213, 36); getContentPane().add(label); final JToolBar toolBar = new JToolBar(); toolBar.setBounds(2, 1, 1016, 34); getContentPane().add(toolBar); final JButton Bangzhu= new JButton(); toolBar.add(Bangzhu); Bangzhu.setIcon(SwingResourceManager.getIcon(Zhuyemian.class, "/帮助.png")); Bangzhu.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));//设置鼠标形状为默认的箭头 Bangzhu.setText("帮助"); final JButton dayin = new JButton(); toolBar.add(dayin); dayin.setIcon(SwingResourceManager.getIcon(Zhuyemian.class, "/print.png")); dayin.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));//设置鼠标形状为默认的箭头 dayin.setText("打印"); final JButton tuichu = new JButton(); toolBar.add(tuichu); tuichu.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent arg0) { int aa=JOptionPane.showConfirmDialog(null, "你确认要退出吗?","确定",2); if(aa==JOptionPane.YES_OPTION){ dispose(); } } }); tuichu.setIcon(SwingResourceManager.getIcon(Zhuyemian.class, "/退出.png")); tuichu.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));//设置鼠标形状为默认的箭头 tuichu.setText("退出"); /*******************************************设定窗体的位置(居中)*******************************************/ Toolkit kit=Toolkit.getDefaultToolkit(); Dimension screen=kit.getScreenSize(); int height=screen.height;//当前屏幕高度 int width=screen.width;//当前屏幕宽度 this.setLocation((width-this.getWidth())/2,(height-this.getHeight())/3); this.setVisible(true); //启动多线程 Thread th =new Thread(this); th.start(); } /*******************************************时钟run方法*******************************************/ public void run() { while(true){ Date d =new Date(); SimpleDateFormat sdf =new SimpleDateFormat("yyyy-M-dd hh:mm:ss"); String str =sdf.format(d); label.setText(str); try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } public static void main(String[] args) { //改变观感 //org.jvnet.substance.SubstanceLookAndFeel try { UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel"); } catch (Exception e) { e.printStackTrace(); } new Zhuyemian(); } } /******************************************添加背景图片*******************************************/ class MyPanel extends JPanel{ //1.从写这个方法 public void paintComponent(Graphics g) { ImageIcon icon = new ImageIcon("zhujiemian.jpg"); g.drawImage(icon.getImage(), 0, 0, this.getWidth(), this.getHeight(), this); } } ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.