📄 application.java
字号:
//Source file: d:/MyProjects/Java/eatbean/eatbean/Application.java
package eatbean;
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
//
import eatbean.conf.SysParam;
public class Application extends Applet {
private final int APP_WIDTH = SysParam.GAME_SCREEN_WIDTH + 10;
private final int APP_HEIGHT = SysParam.GAME_SCREEN_HEIGHT + 32;
public Game game = null;
public void init() {
try {
jbInit();
}
catch(Exception ex) {
ex.printStackTrace();
}
}
public Application() {
}
private void jbInit() throws Exception {
this.setLayout(null);
}
public void start() {
game = new Game();
this.add(game);
game.init();
}
public void stop() {
if(game != null) game.exit();
}
public void paint(Graphics g) {}
public void update(Graphics g) {}
public static void main(String[] args) {
Application app = new Application();
Frame aFrame = new Frame("吃豆子");
aFrame.addWindowListener(
new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
aFrame.add(app, BorderLayout.CENTER);
aFrame.setSize(app.APP_WIDTH, app.APP_HEIGHT);
app.init();
aFrame.setVisible(true);
app.start();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -