屏幕闪烁黑色,然后单独打开JFrame。
public Game() {
myDevice = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
JFrame frame = new JFrame();
// frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
frame.setVisible(true);
frame.add(this);
myDevice.setFullScreenWindow(frame);
try {
} finally {
myDevice.setFullScreenWindow(null);
}
time = 0;
level = new LevelOne(this);
this.requestFocus();
try {
bgImg = ImageIO.read(new File("Space.png"));
} catch (IOException e) {
e.printStackTrace();
}
if (this.getBufferStrategy() == null)
this.createBufferStrategy(2);
bs = this.getBufferStrategy();
timer.schedule(new TimerTask() {
public void run() {
calc();
MobMover.calc();
render();
time++;
}
}, 0L, 40L);
}
我没有看到问题......:'(