public void keyReleased(KeyEvent k) {
}
public void keyTyped(KeyEvent k) {
}
});
}
private void init() {
speedLabel = new JLabel();
snake = new Snake();
setSize(380, 460);
setLayout(null);
this.setResizable(false);
bar = new JMenuBar();
gameMenu = new JMenu("Game");
newItem = new JMenuItem("New Game");
PauseItem = new JMenuItem("Pause");
beginItem = new JMenuItem("Continue");
gameMenu.add(pauseItem);
gameMenu.add(newItem);
gameMenu.add(beginItem); helpMenu = new JMenu("Help"); aboutItem = new JMenuItem("About"); helpMenu.add(aboutItem);
speedMenu = new JMenu("Speed");
slowItem = new JMenuItem("Slow");
fastItem = new JMenuItem("Fast");
midItem = new JMenuItem("Middle");
speedMenu.add(slowItem);
speedMenu.add(midItem);
speedMenu.add(fastItem);
bar.add(gameMenu);
bar.add(helpMenu);
bar.add(speedMenu);
setJMenuBar(bar);
statusLabel = new JLabel();
scoreLabel = new JLabel();
snakePanel = new JPanel();
snakePanel.setBounds(0, 0, 300, 400);
snakePanel.setBorder(BorderFactory.createLineBorder(Color.darkGray)); add(snakePanel);
statusLabel.setBounds(300, 25, 60, 20);
add(statusLabel);