⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hotelintro.java

📁 酒店管理系统后台数据库存储过程
💻 JAVA
字号:
package operation;

import javax.swing.JFrame;
import javax.swing.JLabel;
import java.awt.*;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.FileReader;
import java.io.EOFException;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileWriter;
import java.io.BufferedWriter;
/**
 * <p>Title: Hawaii rummery manage</p>
 *
 * <p>Description: minityperummery manage</p>
 *
 * <p>Copyright: Copyright (c) 2007</p>
 *
 * <p>Company: Yue.</p>
 *
 * @author not attributable
 * @version 1.0
 */
public class HotelIntro extends JFrame {
    public HotelIntro() {
        try {
            jbInit();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    private void jbInit() throws Exception {
        this.getContentPane().setLayout(null);
        lblTitle.setFont(new java.awt.Font("Dialog", Font.PLAIN, 35));
        lblTitle.setForeground(Color.magenta);
        lblTitle.setHorizontalAlignment(SwingConstants.CENTER);
        lblTitle.setText("Hawaii synopsis");
        lblTitle.setBounds(new Rectangle(203, 7, 307, 53));
        mainPan.setBackground(new Color(211, 230, 255));
        mainPan.setBorder(BorderFactory.createEtchedBorder());
        mainPan.setBounds(new Rectangle(45, 68, 610, 424));
        mainPan.setLayout(null);
        showPan.setBorder(BorderFactory.createEtchedBorder());
        showPan.setBounds(new Rectangle(28, 28, 350, 320));
        showPan.setLayout(card);
        btnPause.setBackground(new Color(212, 208, 255));
        btnPause.setBounds(new Rectangle(194, 364, 100, 30));
        btnPause.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
        btnPause.setForeground(Color.blue);
        btnPause.setText("");
        btnPause.addActionListener(new HotelIntro_btnPause_actionAdapter(this));
        btnPlay.setBackground(new Color(212, 208, 255));
        btnPlay.setBounds(new Rectangle(82, 365, 100, 30));
        btnPlay.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
        btnPlay.setForeground(Color.blue);
        btnPlay.setText("");
        btnPlay.addActionListener(new HotelIntro_btnPlay_actionAdapter(this));
        lblP1.setText("");
        lblP2.setText("");
        lblP3.setText("");
        lblP4.setText("");
        lblP5.setText("");
        lblP6.setText("");
        lblP7.setText("");
        lblP8.setText("");
        btExit.setBackground(new Color(212, 208, 255));
        btExit.setBounds(new Rectangle(436, 363, 100, 30));
        btExit.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
        btExit.setForeground(Color.blue);
        btExit.setText("");
        btExit.addActionListener(new HotelIntro_btExit_actionAdapter(this));
        txtShowInfro.setBackground(new Color(249, 249, 236));
        txtShowInfro.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
        txtShowInfro.setForeground(Color.magenta);
        txtShowInfro.setBorder(BorderFactory.createEtchedBorder());
        txtShowInfro.setEditable(false);
        txtShowInfro.setText("");
        txtShowInfro.setLineWrap(true);
        this.getContentPane().setBackground(new Color(223, 255, 255));
        this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
        this.setResizable(false);
        this.setTitle("Hawaii synopsis");
        this.btnPlay.setIcon(new ImageIcon("image\\frame\\HotelIntro\\play.jpg"));
        this.btnPause.setIcon(new  ImageIcon("image\\frame\\HotelIntro\\pause.jpg"));
        this.btExit.setIcon(new ImageIcon("image\\frame\\HotelIntro\\exit.jpg"));


        scrPan.setBorder(BorderFactory.createEtchedBorder());
        scrPan.setBounds(new Rectangle(398, 29, 185, 318));
        mainPan.add(showPan);
        showPan.add(lblP1, "lblP1");
        showPan.add(lblP2, "lblP2");
        showPan.add(lblP3, "lblP3");
        showPan.add(lblP4, "lblP4");
        showPan.add(lblP5, "lblP5");
        showPan.add(lblP6, "lblP6");
        showPan.add(lblP7, "lblP7");
        showPan.add(lblP8, "lblP8");
        mainPan.add(btnPlay);
        mainPan.add(btnPause);
        mainPan.add(btExit);
        mainPan.add(scrPan);
        scrPan.getViewport().add(txtShowInfro);
        this.getContentPane().add(lblTitle);
        this.getContentPane().add(mainPan);
        this.lblP1.setIcon(i1);
        this.lblP2.setIcon(i2);
        this.lblP3.setIcon(i3);
        this.lblP4.setIcon(i4);
        this.lblP5.setIcon(i5);
        this.lblP6.setIcon(i6);
        this.lblP7.setIcon(i7);
        this.lblP8.setIcon(i8);

        try
                {
                        FileReader fr = new FileReader("ProjectFile\\Intro.txt");
                        BufferedReader br = new BufferedReader(fr);        //创建BufferedReader对象

                        String s = br.readLine();     //读出数据
                        String content = s;
                        while (s != null)
                        {
                               // System.out.println(s);       //输出读出的数据
                                s = br.readLine();      // 读取下一行数据
                                if(s!=null)
                                content+="\n"+s;
                        }

                        this.txtShowInfro.setText("        "+content);
                        br.close();            //关闭读入流
                        fr.close();

        }catch(EOFException eof)
        {
                System.out.println("EOF reached");

        }
        catch (IOException ioe)
        {
                ioe.printStackTrace();
        }

        this.btnPlay.setEnabled(false);
         showPicture();

    }

    JLabel lblTitle = new JLabel();
    JPanel mainPan = new JPanel();
    JPanel showPan = new JPanel();
    CardLayout card = new CardLayout();
    JButton btnPause = new JButton();
    JButton btnPlay = new JButton();

    ImageIcon  i1 = new ImageIcon("image\\img\\1001.jpg") ;
    ImageIcon  i2 = new ImageIcon("image\\img\\1002.jpg") ;
    ImageIcon  i3 = new ImageIcon("image\\img\\1003.jpg") ;
    ImageIcon  i4 = new ImageIcon("image\\img\\1004.jpg") ;
    ImageIcon  i5 = new ImageIcon("image\\img\\1005.jpg") ;
    ImageIcon  i6 = new ImageIcon("image\\img\\1006.jpg") ;
    ImageIcon  i7 = new ImageIcon("image\\img\\1007.jpg") ;
    ImageIcon  i8 = new ImageIcon("image\\img\\1008.jpg") ;
    JLabel lblP1 = new JLabel();
    JLabel lblP2 = new JLabel();
    JLabel lblP3 = new JLabel();
    JLabel lblP4 = new JLabel();
    JLabel lblP5 = new JLabel();
    JLabel lblP6 = new JLabel();
    JLabel lblP7 = new JLabel();
    JLabel lblP8 = new JLabel();
    static   Timer timer;
    static int number = 0;
    JButton btExit = new JButton();
    JTextArea txtShowInfro = new JTextArea();
    JScrollPane scrPan = new JScrollPane();
    public void btnPlay_actionPerformed(ActionEvent e) {
        this.btnPlay.setEnabled(false);
     showPicture();
    }

    public void btnPause_actionPerformed(ActionEvent e) {
        this.btnPlay.setEnabled(true);
        timer.stop();
    }

    public void showPicture()
    {
        ActionListener show = new ActionListener(){
           public void actionPerformed(ActionEvent e){
                number++;
                String name= "lblP"+number;
                card.show(showPan, name);
                if(number==8)
                {
                   number=0;
                }
          }
       };

       timer = new Timer(1500,show);
       timer.start();
    }

    public void btExit_actionPerformed(ActionEvent e) {

        this.dispose();
    }


}


class HotelIntro_btExit_actionAdapter implements ActionListener {
    private HotelIntro adaptee;
    HotelIntro_btExit_actionAdapter(HotelIntro adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.btExit_actionPerformed(e);
    }
}


class HotelIntro_btnPause_actionAdapter implements ActionListener {
    private HotelIntro adaptee;
    HotelIntro_btnPause_actionAdapter(HotelIntro adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.btnPause_actionPerformed(e);
    }
}


class HotelIntro_btnPlay_actionAdapter implements ActionListener {
    private HotelIntro adaptee;
    HotelIntro_btnPlay_actionAdapter(HotelIntro adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.btnPlay_actionPerformed(e);
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -