Java-酒店管理系统

一,采用的是model2三层模型开发
一个为主界面,index ,一个为登录界面UserLogin
1、
package com.mol.view;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;

import javax.swing.JPanel;
import javax.swing.JWindow;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
public class Index extends JWindow implements Runnable{
//定义为成员变量,将应用类型嵌入到Window窗口中!
paint p;
public static void main(String[] args) {

    try {
        // 将当前窗体外观设置为所在操作系统的外观
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (ClassNotFoundException e) {
        e.printStackTrace();
    } catch (InstantiationException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (UnsupportedLookAndFeelException e) {
        e.printStackTrace();
    }
    Index index = new Index();
    Thread t = new Thread(index);
    t.start();
}
//构造方法用来初始化变量和方法
public Index() {
    // 创建P
    p = new paint();
    this.add(p);

    this.setSize(400, 250);
    // 确定Jwindow初始位置
    this.setLocationRelativeTo(null);
    this.setVisible(true);
}

//线程方法,跳出登录页面
public void run() {
    while(true) {
        try {
            Thread.sleep(29*500);
        } catch (Exception e) {
            e.printStackTrace();
        }
        this.dispose();
        //跳转到登录页面
        new UserLogin();
        break;

    }

}

}
//定义一个闪屏类方法
class paint extends JPanel implements Runnable{// 可以自动刷新Panel
Thread t;
int x = 10;
int i = 0, j = 40, u = 10;
String gg[] = { “系”, “统”, “正”, “在”, “加”, “载”, “请”, “稍”, “侯” };
int k = 0, tt = 0;
String shi[] = { “满”, “汉”, “楼”, “融”, “满”, “汉”, “精”, “华”, “做”, “天”, “下”,
“美”, “味”, “招”, “八”, “方”, “食”, “客”, “结”, “四”, “海”, “良”, “朋”,
“满”, “汉”, “楼”, “程”, “序”, “演”, “示” };
Font f = new Font(“隶书”, Font.PLAIN, 18);

boolean ifok = true;
int width = 180;
int height = 0;
int dian = 0;

paint() {
    t = new Thread(this);
    t.start();
}

public void run() {
    while (true) {
        if (x <= 380);
        repaint();
        try {
            Thread.sleep(70);
            i++;// i=0
            j = j - 6;// j=40
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值