?? snakegame.java~8~
字號(hào):
package com.cxlife.snake;/** *功能描述:演示如何控制蛇體的運(yùn)動(dòng)。 * Author: 張樂(lè)! * */import java.awt.*;import java.awt.event.*;import java.applet.*;import javax.swing.*;public class SnakeGame extends Applet { private boolean isStandalone = false; private JPanel jPanel1 = JFrame.jPane1; private BorderLayout borderLayout1 = new BorderLayout(); //Get a parameter value public String getParameter(String key, String def) { return isStandalone ? System.getProperty(key, def) : (getParameter(key) != null ? getParameter(key) : def); } //Construct the applet public SnakeGame() { } //Initialize the applet public void init() { try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } //Component initialization private void jbInit() throws Exception { this.setLayout(borderLayout1); jPanel1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(MouseEvent e) { jPanel1_mouseClicked(e); } }); this.add(jPanel1, BorderLayout.CENTER); } //Get Applet information public String getAppletInfo() { return "Applet Information"; } //Get parameter info public String[][] getParameterInfo() { return null; } void jPanel1_mouseClicked(MouseEvent e) { jPanel1.requestFocus(); }}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -