原文:java swing编写俄罗斯方块小游戏源代码下载?源代码下载地址:http://www.zuidaima.com/share/1550463301618688.htm
?
小弟写的俄罗斯方块小游戏 目前能正常运行 忘各位指出不对的地方
class="lazy img-rounded">
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 } }