gamehall.java

来自「QQ游戏大厅」· Java 代码 · 共 45 行

JAVA
45
字号

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
/**
 * @author  yeeku.H.lee kongyeeku@163.com
 * @version  1.0
 * <br>Copyright (C), 2005-2008, yeeku.H.Lee
 * <br>This program is protected by copyright laws.
 * <br>Program Name:
 * <br>Date: 
 */
public class GameHall extends JFrame
{
	private InfoSave infoSave;
	ChatSystem chatSystem = new ChatSystem();
	HallPanel hallPanel = new HallPanel(25 , 5);
	private JSplitPane split;
	private JScrollPane scroll;

	public void init(InfoSave infoSave)
	{
		this.infoSave = infoSave;
		chatSystem.setInfoSave(infoSave);
		chatSystem.init();
		hallPanel.setInfoSave(infoSave);

		scroll = new JScrollPane(hallPanel);
		split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
		split.setLeftComponent(scroll);
		split.setRightComponent(chatSystem);
		scroll.setMinimumSize(new Dimension(703, 600));
		this.add(split);	
		this.setPreferredSize(new Dimension(1021, 737));
		this.pack();
		this.setResizable(false);
		//设置窗台在屏幕中心显示
		this.setLocationRelativeTo(null);
		//设置按关闭窗体时退出程序,默认只是隐藏窗体
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);  
		this.setTitle("五子棋游戏大厅");
		this.setVisible(true);
	}
}

⌨️ 快捷键说明

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