java雷電遊戲原始碼專案
阿新 • • 發佈:2019-02-08
部分程式碼GameFrame .java
package com.leidian; import java.awt.BorderLayout; import javax.swing.JFrame; public class GameFrame extends JFrame { private static final long serialVersionUID = 1L; private GameCanvas canvas = new GameCanvas(); public GameFrame() { canvas.setFocusable(true); canvas.requestFocus(); this.add(canvas, BorderLayout.CENTER); } /** * @param args */ public static void main(String[] args) { GameFrame frame = new GameFrame(); frame.setSize(400, 630); frame.setIconImage(Resources.tombPNG); frame.setTitle("java雷電遊戲"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } }
效果圖:
<ignore_js_op>
<ignore_js_op>
<ignore_js_op>