java swing编写俄罗斯方块小游戏源代码下载

原文:java swing编写俄罗斯方块小游戏源代码下载 源代码下载地址:http://www.zuidaima.com/share/1550463301618688.htm

小弟写的俄罗斯方块小游戏 目前能正常运行 忘各位指出不对的地方

java swing编写俄罗斯方块小游戏源代码下载

package com.zuidaima.russia.game.square;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.*;


/**
*@author www.zuidaima.com
**/
@SuppressWarnings("serial")
public class GameStart extends JFrame {
	public GameStart() {
		init();

	}

	private void init() {

		setTitle("俄罗斯方块");
		RussiaGame rus = new RussiaGame();
		JMenuBar menu = new JMenuBar();

		setJMenuBar(menu);
		JMenu help = new JMenu("帮助");
		help.setActionCommand("help");
		JMenuItem about = help.add("关于");
		about.setActionCommand("about");
		 setUndecorated(true); 
		about.addActionListener(new ActionListener() {

		public void actionPerformed(ActionEvent e) {
				StringBuilder sbd = new StringBuilder();
				
				sbd.append("制作人:小李 我们一起交流 互相学习");
				if (e.getActionCommand().equals("about"))
					JOptionPane.showMessageDialog(null, sbd.toString());

			}
		});
		add(rus, java.awt.BorderLayout.CENTER);
	    addKeyListener(rus);
		menu.add(help);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setUndecorated(true);
		setSize(500, 500);
		setLocation(300,200); 
		setVisible(true);
  
		setResizable(false);

	}

	public static void main(String[] args) {
		new GameStart();
	}

	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub

	}

}

 标签: swing 游戏 java 俄罗斯方块 下载话题: Swing和AWT开发 游戏开发

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值