package com.xiaoqie.view;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import javax.imageio.ImageIO;
import javax.swing.*;
import com.xiaoqie.model.ImagePanel;
import com.xiaoqie.model.MenuModel;
public class Window1 extends JFrame implements ActionListener, MouseListener {
private static final long serialVersionUID = -566271097152066682L;
private Image titleIcon, timeBG;
private JMenuBar jmb;
private JMenu jm1, jm2, jm3, jm4, jm5, jm6;
private JMenuItem jmm1, jmm2, jmm3, jmm4, jmm5, jmm6, jmm7, jmm8, jmm9,
jmm10, jmm11, jmm12;
private JToolBar jtb;
private JButton jbt1, jbt2, jbt3, jbt4, jbt5, jbt6, jbt7, jbt8, jbt9,
jbt10;
private JPanel p1, p2, p3, p4, p5;
private JPanel p3_2, p3_3, p3_5, p3_6, p3_7;
private JLabel time, p1_label1, p1_label2, p1_label3, p1_label4, p1_label5,
p1_label6, p1_label7, p1_label8;
private Timer t;
private ImagePanel p1_img;
private Image p3_bg;
private JLabel p3_l2, p3_l3, p3_l5, p3_l6, p3_l7;
private JLabel p2_l1, p2_l2;
private JSplitPane jsp1;
private CardLayout cardp2, cardp3;
private Cursor myCursor = new Cursor(Cursor.HAND_CURSOR);
private String selectedItem = "";
private JTable jtable;
private JScrollPane jsp;
private MenuModel em;
private Chart chart;
public static void main(String[] args) {
new Window1("0", "");
}
public Window1(String power, String name) {
try {
titleIcon = ImageIO.read(new File("image/title.gif"));
} catch (IOException e) {
e.printStackTrace();
}
jm1 = new JMenu("系统管理");
jm1.setFont(UserLogin.f1);
jmm1 = new JMenuItem("切换用户");
jmm1.setFont(UserLogin.f2);
jmm2 = new JMenuItem("切换到收款界面");
jmm2.setFont(UserLogin.f2);
jmm3 = new JMenuItem("登陆管理");
jmm3.setFont(UserLogin.f2);
jmm4 = new JMenuItem("万年历");
jmm4.setFont(UserLogin.f2);
jmm5 = new JMenuItem("退出");
jmm5.setFont(UserLogin.f2);
jm1.add(jmm1);
jm1.add(jmm2);
jm1.add(jmm3);
jm1.add(jmm4);
jm1.add(jmm5);
jm2 = new JMenu("人事管理");
jm2.setFont(UserLogin.f1);
jmm6 = new JMenuItem("人事登记");
jmm6.setFont(UserLogin.f2);
jm2.add(jmm6);
jm3 = new JMenu("菜单服务");
jm3.setFont(UserLogin.f1);
jmm7 = new JMenuItem("菜谱及价格录入");
jmm7.setFont(UserLogin.f2);
jm3.add(jmm7);
jm4 = new JMenu("报表统计");
jm4.setFont(UserLogin.f1);
jmm8 = new JMenuItem("报表统计");
jmm8.setFont(UserLogin.f2);
jm4.add(jmm8);
jm5 = new JMenu("成本及库房");
jm5.setFont(UserLogin.f1);
jmm9 = new JMenuItem("成本控制");
jmm9.setFont(UserLogin.f2);
jm5.add(jmm9);
jm6 = new JMenu("帮助");
jm6.setFont(UserLogin.f1);
jmm10 = new JMenuItem("动画帮助");
jmm10.setFont(UserLogin.f2);
jmm11 = new JMenuItem("文字帮助");
jmm11.setFont(UserLogin.f2);
jmm12 = new JMenuItem("关于");
jmm12.setFont(UserLogin.f2);
jm6.add(jmm10);
jm6.add(jmm11);
jm6.add(jmm12);
jmb = new JMenuBar();
jmb.add(jm1);
jmb.add(jm2);
jmb.add(jm3);
jmb.add(jm4);
jmb.add(jm5);
jmb.add(jm6);
jtb = new JToolBar();
jtb.setFloatable(false);
jbt1 = new JButton("切换到收款界面");
jbt1.setFont(UserLogin.f1);
jbt2 = new JButton("切换用户");
jbt2.setFont(UserLogin.f1);
jbt3 = new JButton("登录管理");
jbt3.setFont(UserLogin.f1);
jbt4 = new JButton("人事登记");
jbt4.setFont(UserLogin.f1);
jbt5 = new JButton("报表统计");
jbt5.setFont(UserLogin.f1);
jbt6 = new JButton("菜谱及价格收入");
jbt6.setFont(UserLogin.f1);
jbt7 = new JButton("成本控制");
jbt7.setFont(UserLogin.f1);
jbt8 = new JButton("关于");
jbt8.setFont(UserLogin.f1);
jbt9 = new JButton("动画帮助");
jbt9.setFont(UserLogin.f1);
jbt10 = new JButton("文字帮助");
jbt10.setFont(UserLogin.f1);
jtb.add(jbt1);
jtb.add(jbt2);
jtb.add(jbt3);
jtb.add(jbt4);
jtb.add(jbt5);
jtb.add(jbt6);
jtb.add(jbt7);
jtb.add(jbt8);
jtb.add(jbt9);
jtb.add(jbt10);
p5 = new JPanel(new BorderLayout());
t = new Timer(1000, this);
t.start();
this.time = new JLabel(
"当前时间:"
+ new SimpleDateFormat("yyyy-MM-dd-a:HH:mm:ss")
.format(java.util.Calendar.getInstance()
.getTime()));
this.time.setFont(UserLogin.f1);
try {
timeBG = ImageIO.read(new File("image/time_bg.jpg"));
} catch (IOException e) {
e.printStackTrace();
}
ImagePanel ip = new ImagePanel(timeBG);
ip.setLayout(new BorderLayout());
ip.add(time, "East");
p5.add(ip);
p1 = new JPanel(new BorderLayout());
try {
this.p1_img = new ImagePanel(ImageIO.read(new File("image/bg.gif")));
} catch (IOException e) {
e.printStackTrace();
}
p1_img.setLayout(new GridLayout(8, 1));
p1_label1 = new JLabel("餐饮管理系统", 0);
p1_label1.setFont(UserLogin.f3);
p1_img.add(p1_label1);
p1_label2 = new JLabel("人 事 管 理", 0);
p1_label2.setFont(UserLogin.f3);
p1_label2.setCursor(myCursor);
p1_label2.setForeground(Color.GRAY);
p1_label2.addMouseListener(this);
p1_img.add(p1_label2);
p1_label3 = new JLabel("登 陆 管 理", 0);
p1_label3.setFont(UserLogin.f3);
p1_label3.setCursor(myCursor);
p1_label3.setForeground(Color.GRAY);
p1_label3.addMouseListener(this);
p1_img.add(p1_label3);
p1_label4 = new JLabel("菜 谱 价 格", 0);
p1_label4.setFont(UserLogin.f3);
p1_label4.setCursor(myCursor);
p1_label4.setForeground(Color.GRAY);
p1_label4.addMouseListener(this);
p1_img.add(p1_label4);
p1_label5 = new JLabel("报 表 统 计", 0);
p1_label5.setFont(UserLogin.f3);
p1_label5.setCursor(myCursor);
p1_label5.setForeground(Color.GRAY);
p1_label5.addMouseListener(this);
p1_img.add(p1_label5);
p1_label6 = new JLabel("成本及库房", 0);
p1_label6.setFont(UserLogin.f3);
p1_label6.setCursor(myCursor);
p1_label6.setForeground(Color.GRAY);
p1_label6.addMouseListener(this);
p1_img.add(p1_label6);
p1_label7 = new JLabel("系 统 设 置", 0);
p1_label7.setFont(UserLogin.f3);
p1_label7.setCursor(myCursor);
p1_label7.setForeground(Color.GRAY);
p1_label7.addMouseListener(this);
p1_img.add(p1_label7);
p1_label8 = new JLabel("动 画 帮 助", 0);
p1_label8.setFont(UserLogin.f3);
p1_label8.setCursor(myCursor);
p1_label8.setForeground(Color.GRAY);
p1_label8.addMouseListener(this);
p1_img.add(p1_label8);
p1.add(p1_img);
p4 = new JPanel(new BorderLayout());
this.cardp2 = new CardLayout();
// 设置jp2为卡片布局
p2 = new JPanel(cardp2);
// 创建两个标签(左,右)用于当点击时,拆分窗口的显示区域
p2_l1 = new JLabel(new ImageIcon("image/center_image/jp2_left.gif"));
p2_l1.addMouseListener(this);
p2_l2 = new JLabel(new ImageIcon("image/center_image/jp2_right.gif"));
p2_l2.addMouseListener(this);
// 把jp2_lab1,jp2_lab2加入到jp2中,jp2是卡片布局
p2.add(p2_l1, "0");
p2.add(p2_l2, "1");
this.cardp3 = new CardLayout();
p3 = new JPanel(cardp3);
ImagePanel ip_p3 = new ImagePanel(p3_bg);
// 创建两个图片标签用于测试卡片布局
// p3_l1 = new JLabel(new ImageIcon("image/jp3_test/jp3_1.jpg"));
p3_l2 = new JLabel(new ImageIcon("image/jp3_test/jp3_2.jpg"));
p3_l3 = new JLabel(new ImageIcon("image/jp3_test/jp3_3.jpg"));
p3_l5 = new JLabel(new ImageIcon("image/jp3_test/jp3_5.jpg"));
p3_l6 = new JLabel(new ImageIcon("image/jp3_test/jp3_6.jpg"));
p3_l7 = new JLabel(new ImageIcon("image/jp3_test/jp3_7.jpg"));
// 创建各功能块对应的卡片面板
EmpInfo emp = new EmpInfo();
LoginInfo lif = new LoginInfo();
p3_2 = new JPanel();
p3_2.add(p3_l2);
p3_3 = new JPanel();
p3_3.add(p3_l3);
p3_5 = new JPanel();
p3_5.add(p3_l5);
p3_6 = new JPanel();
p3_6.add(p3_
没有合适的资源?快使用搜索试试~ 我知道了~
java/swing/j2se编写开发的酒店管理系统
共92个文件
jpg:39个
class:24个
java:15个
5星 · 超过95%的资源 需积分: 10 34 下载量 196 浏览量
2011-04-04
11:03:42
上传
评论
收藏 5.33MB ZIP 举报
温馨提示
java/swing/j2se编写开发的酒店管理系统(非常详细易懂的代码)
资源推荐
资源详情
资源评论
收起资源包目录
Restaurant.zip (92个子文件)
Restaurant
.project 386B
bin
com
xiaoqie
view
Window2_Window3_Server$Client.class 3KB
EmpInfo.class 5KB
Window3$TableSelecting.class 1KB
UserLogin.class 4KB
LoginInfo.class 5KB
Window3$1.class 885B
UserLogin$BackGroundImage.class 1KB
Window2$RecvThread.class 2KB
Window1.class 13KB
Chart.class 3KB
Index.class 2KB
Window3.class 8KB
Window3$RecvThread.class 1KB
Window2.class 4KB
Window3$ButtonListener.class 3KB
Window2_Window3_Server.class 2KB
Window2$1.class 885B
Paint.class 6KB
db
DB.class 2KB
model
MenuModel.class 3KB
CodeCounter.class 3KB
EmpModel.class 4KB
UserModel.class 2KB
ImagePanel.class 1KB
.settings
org.eclipse.jdt.core.prefs 629B
image
qhyh.jpg 1KB
wnl.jpg 1KB
bg.gif 275KB
jt4.jpg 1018B
jb10.jpg 1015B
exit.jpg 1KB
jt9.jpg 1KB
label_1.gif 13KB
time_bg.jpg 900B
jb3.jpg 918B
p1.jpg 1KB
qhsy.jpg 1KB
jt5.jpg 999B
index
index.gif 69KB
Thumbs.db 13KB
index.jpg 46KB
jb4.jpg 1018B
jp3_test
jp3_2.jpg 488KB
jp3_7.jpg 473KB
jp3_4.jpg 497KB
jp3_1.jpg 1.27MB
jp3_3.jpg 585KB
Thumbs.db 33KB
jp3_6.jpg 801KB
jp3_5.jpg 620KB
jb2.jpg 2KB
jt7.jpg 1KB
Thumbs.db 22KB
center_image
label_4.jpg 1KB
label_6.jpg 1KB
jp2_right.gif 122B
label_1.gif 13KB
jp2_left.jpg 828B
jp2_right.jpg 831B
jp3_bg.jpg 210KB
label_2.jpg 1KB
jp2_left.gif 122B
label_8.jpg 1KB
jp1_bg.jpg 1KB
label_3.jpg 1KB
label_7.jpg 1KB
Thumbs.db 29KB
label_5.jpg 1KB
title.gif 1024B
jt6.jpg 942B
jb1.jpg 2KB
login.jpg 1KB
jt3.jpg 918B
UserLogin.JPG 13KB
jt8.jpg 1021B
src
com
xiaoqie
view
Window3.java 6KB
Window2.java 3KB
UserLogin.java 3KB
Chart.java 2KB
Window2_Window3_Server.java 2KB
EmpInfo.java 4KB
Index.java 7KB
LoginInfo.java 3KB
Window1.java 13KB
db
DB.java 2KB
model
ImagePanel.java 572B
CodeCounter.java 2KB
UserModel.java 950B
EmpModel.java 2KB
MenuModel.java 1KB
.classpath 430B
共 92 条
- 1
资源评论
- java_奋斗2014-06-30例子很充分!
猴子搬来的救兵Castiel
- 粉丝: 3577
- 资源: 902
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功